Skip to content

FIX: Add default precision to db#1166

Merged
mockdeep merged 2 commits into
stringer-rss:mainfrom
RobBoothAppDev21:add_precision_default
Mar 14, 2024
Merged

FIX: Add default precision to db#1166
mockdeep merged 2 commits into
stringer-rss:mainfrom
RobBoothAppDev21:add_precision_default

Conversation

@RobBoothAppDev21

Copy link
Copy Markdown
Contributor

Generate migration file to set the default precision to 6 for datetime columns in the database

Comment thread db/schema.rb Outdated
t.string "name", limit: 255, null: false
t.datetime "created_at", precision: nil, null: false
t.datetime "updated_at", precision: nil, null: false
create_table "groups", force: :cascade do |t|

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this also introduced changes to the primary key. We'll need a migration for that as well to ensure that production instances get updated.

Comment thread db/schema.rb Outdated
t.string "username", null: false
create_table "users", force: :cascade do |t|
t.string "password_digest"
t.datetime "created_at"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we lost the null: false from some of these.

Comment thread db/schema.rb Outdated
t.string "api_key", limit: 255, null: false
t.string "username", null: false
create_table "users", force: :cascade do |t|
t.string "password_digest"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this changed as well. Probably need a separate migration to remove the limit here.

Generate migration file to set the default precision
for datetime columns in the database
@mockdeep mockdeep force-pushed the add_precision_default branch from c83f8c2 to fcb22a6 Compare March 14, 2024 03:09
@mockdeep mockdeep merged commit 55cf91a into stringer-rss:main Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants