diff --git a/db/migrate/20231107211623_add_confirmed_to_users.rb b/db/migrate/20231107211623_add_confirmed_to_users.rb new file mode 100644 index 00000000..5c566b29 --- /dev/null +++ b/db/migrate/20231107211623_add_confirmed_to_users.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddConfirmedToUsers < ActiveRecord::Migration + def up + execute <<-SQL + ALTER FOREIGN TABLE users ADD COLUMN confirmed_at TIMESTAMP DEFAULT NULL + SQL + end + + def down + execute <<-SQL + ALTER FOREIGN TABLE users DROP COLUMN IF EXISTS confirmed_at; + SQL + end +end diff --git a/db/schema.rb b/db/schema.rb index 0f456c40..c150aee2 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20180518132406) do +ActiveRecord::Schema.define(version: 20231107211623) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 91fbbf28..a6905f44 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -79,7 +79,8 @@ namespace :panoptes do zooniverse_id varchar(255), credited_name varchar(255), admin bool, - banned bool + banned bool, + confirmed_at timestamp(6) ) server panoptes; create foreign table if not exists oauth_access_tokens ( @@ -232,7 +233,8 @@ namespace :panoptes do banned boolean default false not null, migrated boolean default false, valid_email boolean default true not null, - uploaded_subjects_count integer default 0 + uploaded_subjects_count integer default 0, + confirmed_at timestamp(6) without time zone default null ); drop table if exists oauth_access_tokens;