-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make timestamps nullable in MySQL 5.7 #8
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8 +/- ##
=======================================
Coverage 92.07% 92.07%
=======================================
Files 7 7
Lines 227 227
=======================================
Hits 209 209
Misses 18 18
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to explicitly declare the column NULL
(not to mention you're then disabling the logic that specifies the correct database-specific name for timestamp columns), just add the default.
.column("id", type: .text, .primaryKey(autoIncrement: false)) | ||
.column("queue_name", type: .text, .notNull) | ||
.column("job_name", type: .text, .notNull) | ||
.column("queued_at", type: .timestamp, .notNull) | ||
.column("delay_until", type: .custom(SQLRaw("TIMESTAMP NULL")), .default(SQLLiteral.null)) | ||
.column("state", type: .custom(SQLRaw(stateEnumType)), .notNull) | ||
.column("max_retry_count", type: .int, .notNull) | ||
.column("attempts", type: .int, .notNull) | ||
.column("payload", type: .blob, .notNull) | ||
.column("updated_at", type: .custom(SQLRaw("TIMESTAMP NULL")), .default(SQLLiteral.null)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.column("id", type: .text, .primaryKey(autoIncrement: false)) | |
.column("queue_name", type: .text, .notNull) | |
.column("job_name", type: .text, .notNull) | |
.column("queued_at", type: .timestamp, .notNull) | |
.column("delay_until", type: .custom(SQLRaw("TIMESTAMP NULL")), .default(SQLLiteral.null)) | |
.column("state", type: .custom(SQLRaw(stateEnumType)), .notNull) | |
.column("max_retry_count", type: .int, .notNull) | |
.column("attempts", type: .int, .notNull) | |
.column("payload", type: .blob, .notNull) | |
.column("updated_at", type: .custom(SQLRaw("TIMESTAMP NULL")), .default(SQLLiteral.null)) | |
.column("id", type: .text, .primaryKey(autoIncrement: false)) | |
.column("queue_name", type: .text, .notNull) | |
.column("job_name", type: .text, .notNull) | |
.column("queued_at", type: .timestamp, .notNull) | |
.column("delay_until", type: .timestamp, .default(SQLLiteral.null)) | |
.column("state", type: .custom(SQLRaw(stateEnumType)), .notNull) | |
.column("max_retry_count", type: .int, .notNull) | |
.column("attempts", type: .int, .notNull) | |
.column("payload", type: .blob, .notNull) | |
.column("updated_at", type: .timestamp, .default(SQLLiteral.null)) |
Superseded by bc47078 |
No description provided.