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

Generator make wrong migration for Oracle database #1242

Closed
ukolovda opened this issue Apr 24, 2020 · 5 comments
Closed

Generator make wrong migration for Oracle database #1242

ukolovda opened this issue Apr 24, 2020 · 5 comments

Comments

@ukolovda
Copy link

ukolovda commented Apr 24, 2020

Thank you for your contribution!

Generated migration for table versions have type integer for column item_id.
Latest Rails uses bigint for object ids.

However it works fine for PostgreSQL and SQLite3.

But my test crash for Oracle database, because t.integer :item_id, null: false, limit: 8 translated to type NUMBER(8), and have no space for 9-digits IDs from fixtures. (I use gem activerecord-oracle_enhanced-adapter)

Describe the solution you'd like to build

Please, consider changing in migration generator for table versions from
t.integer :item_id, null: false, limit: 8
to
t.bigint :item_id, null: false

@gurgelrenan
Copy link
Member

Hi @ukolovda, thanks for your time to report this issue. Bug reports must use the issue template https://github.com/paper-trail-gem/paper_trail/blob/master/.github/ISSUE_TEMPLATE/bug-report.md, please update your issue in order to help us.

@marceloperini
Copy link
Contributor

@ukolovda what version of activerecord-oracle_enhanced-adapter you are using? The last version use NUMBER(38) as integer.

@ukolovda
Copy link
Author

@marceloperini , I use activerecord-oracle_enhanced-adapter 6.0.2
Migration generator have
t.integer :item_id, null: false, limit: 8
and for Oracle it create NUMBER(8) column type.

marceloperini added a commit to marceloperini/paper_trail that referenced this issue May 26, 2020
jaredbeck pushed a commit that referenced this issue May 28, 2020
* convert `item_id` field to bigint

* add fix to #1242 issue to CHANGELOG.md

* change item_id type on dummy schema
@gurgelrenan
Copy link
Member

gurgelrenan commented May 28, 2020

Fixed on #1245

@marceloperini
Copy link
Contributor

@ukolovda can you test this issue using the master branch of this respository?

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

No branches or pull requests

3 participants