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

Consumer_Tokens missing columns / Migrations issue in SQlite? #105

Open
tarr11 opened this issue Dec 24, 2011 · 1 comment
Open

Consumer_Tokens missing columns / Migrations issue in SQlite? #105

tarr11 opened this issue Dec 24, 2011 · 1 comment

Comments

@tarr11
Copy link

tarr11 commented Dec 24, 2011

i attempted to run rake db:migrate after generating the client, I received this error:

== CreateOauthConsumerTokens: migrating ======================================
-- create_table(:consumer_tokens)
rake aborted!
An error has occurred, this and all later migrations canceled:

SQLite3::SQLException: table "consumer_tokens" already exists: CREATE TABLE "consumer_tokens" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "type" varchar(30), "token" varchar(1024), "secret" varchar(255), "created_at" datetime, "updated_at" datetime)

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Since this is a test app, i just reset my db and recreate it using rake db:create and then deleted this migration.

Then, the app worked, bu t it appears to have been expecting these columns authorized_at, invalidated_at, expires_at on consumer_tokens

I was able to resolve that issue by generating a migration myself.

rails generate migration AddTimestampsToConsumerTokens authorized_at:timestamp invalidated_at:timestamp expires_at:timestamp

rake db:migrate
Not sure if this is something that is either specific to SQLite, or something I may have done (I am using devise fwiw)

@gregawoods
Copy link

Had the same problem, in mysql. Your migration worked for me.

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

2 participants