nejdetkadir / devise-api

The devise-api gem is a convenient way to add authentication to your Ruby on Rails application using the devise gem. It provides support for access tokens and refresh tokens, which allow you to authenticate API requests and keep the user's session active for a longer period of time on the client side
MIT License
152 stars 22 forks source link

ActiveRecord::NotNullViolation (PG::NotNullViolation: ERROR: null value in column "resource_owner_id" #22

Closed chridubois closed 1 year ago

chridubois commented 1 year ago

Hi,

i've tried to do what you suggest in #11 . I've created a new migration :

class ChangeUuidColumnType < ActiveRecord::Migration[7.0] def change change_column :devise_api_tokens, :resource_owner_id, :primary_key end end

and I get this error :

== 20230529143952 ChangeUuidColumnType: migrating ============================= -- change_column(:devise_api_tokens, :resource_owner_id, :primary_key) rails aborted! StandardError: An error has occurred, this and all later migrations canceled:

PG::SyntaxError: ERROR: syntax error at or near "primary" LINE 1: ..." ALTER COLUMN "resource_owner_id" TYPE bigserial primary ke...

Did I miss something ?