Skip to content
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

Fix migration timestamp column data type issue #467

Merged
merged 1 commit into from
Oct 16, 2021
Merged

Fix migration timestamp column data type issue #467

merged 1 commit into from
Oct 16, 2021

Conversation

hbjydev
Copy link
Contributor

@hbjydev hbjydev commented Oct 15, 2021

I was running into an issue when trying to run migrations on Postgres where it was trying to allocate too many digits to an integer. This changes that data type to a bigint to resolve that problem.

Copy link
Member

@SamuelScheit SamuelScheit left a comment

Choose a reason for hiding this comment

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

The migration script in Database.ts is wrong and should set the timestamp as seconds (not as ms)

@hbjydev
Copy link
Contributor Author

hbjydev commented Oct 15, 2021

@Flam3rboy It should probably still be a bigint, if it's holding a UNIX Timestamp.

@SamuelScheit
Copy link
Member

BigInts are not supported by sqlite, we need to find a solution. Either ditch sqlite or maybe save it as string?

@erkinalp
Copy link
Contributor

SQLite does support 64-bit integers, which is really all we need in terms of integers.

See: https://www.sqlite.org/datatype3.html

@SamuelScheit
Copy link
Member

@erkinalp what is the sqlite data type called? REAL is floating point number and not a 64 bit integer.

@SamuelScheit SamuelScheit merged commit a152cae into spacebarchat:master Oct 16, 2021
@erkinalp
Copy link
Contributor

@Flam3rboy INTEGER in SQLite 3.

@hbjydev hbjydev deleted the fix-migration-column-issue branch October 17, 2021 11:06
MaddyUnderStars pushed a commit that referenced this pull request Mar 1, 2023
Fix migration timestamp column data type issue
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.

4 participants