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 migrations #1

Closed
wants to merge 1 commit into from
Closed

Fix migrations #1

wants to merge 1 commit into from

Conversation

zavan
Copy link
Contributor

@zavan zavan commented Mar 27, 2023

3 changes:

  1. Changed ids and foreign key columns to use bigint instead of int. Rodauth (and ActiveRecord) now uses bigint columns for the ids, so using int for the foreign keys doesn't work.

  2. Added missing index keys for some unique fields to fix ArgumentError: Unknown key: :unique. error.

  3. ActiveRecord now uses precision 6 for datetime fields by default, so the default values must also specify that. See this.

3 changes:

1. Changed ids and foreign key columns to use `bigint` instead of `int`. Rodauth (and Rails) now uses `bigint` columns for the ids, so using `int` for the foreign keys doesn't work.

2. Added missing `index` keys for some unique fields to fix `ArgumentError: Unknown key: :unique.` error.

3. Rails now uses precision 6 for `datetime` fields by default, so the default values must also specify that. See [this](janko/rodauth-rails#159).
@zavan
Copy link
Contributor Author

zavan commented Mar 27, 2023

Another one:

Trilogy::ProtocolError: 1072: Key column 'code' doesn't exist in table /app/db/migrate/20230327145623_create_rodauth_oauth.rb:101:in change'`

    create_table :oauth_pushed_requests do |t|
      t.bigint :oauth_application_id
      t.foreign_key :oauth_applications, column: :oauth_application_id
      t.string :params, null: false
      t.datetime :expires_in, null: false
      t.index %i[oauth_application_id ->>>>code<<<<-], unique: true
    end

That column doesn't exist on the table, not sure what to do about this one.

@zavan
Copy link
Contributor Author

zavan commented Mar 27, 2023

Closing because I just noticed PRs are supposed to go on GitLab.

https://gitlab.com/os85/rodauth-oauth/-/merge_requests/117

@zavan zavan closed this Mar 27, 2023
@zavan zavan deleted the patch-1 branch March 27, 2023 20:05
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.

None yet

1 participant