about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180109143959_add_remember_token_to_users.rb5
-rw-r--r--db/migrate/20180204034416_create_identities.rb11
-rw-r--r--db/migrate/20180206000000_change_user_id_nonnullable.rb6
-rw-r--r--db/migrate/20180211015820_create_backups.rb11
-rw-r--r--db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb5
-rw-r--r--db/schema.rb31
6 files changed, 66 insertions, 3 deletions
diff --git a/db/migrate/20180109143959_add_remember_token_to_users.rb b/db/migrate/20180109143959_add_remember_token_to_users.rb
new file mode 100644
index 000000000..662905bcb
--- /dev/null
+++ b/db/migrate/20180109143959_add_remember_token_to_users.rb
@@ -0,0 +1,5 @@
+class AddRememberTokenToUsers < ActiveRecord::Migration[5.1]
+  def change
+    add_column :users, :remember_token, :string, null: true
+  end
+end
diff --git a/db/migrate/20180204034416_create_identities.rb b/db/migrate/20180204034416_create_identities.rb
new file mode 100644
index 000000000..f6f5da910
--- /dev/null
+++ b/db/migrate/20180204034416_create_identities.rb
@@ -0,0 +1,11 @@
+class CreateIdentities < ActiveRecord::Migration[5.0]
+  def change
+    create_table :identities do |t|
+      t.references :user, foreign_key: { on_delete: :cascade }
+      t.string :provider, null: false, default: ''
+      t.string :uid, null: false, default: ''
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/migrate/20180206000000_change_user_id_nonnullable.rb b/db/migrate/20180206000000_change_user_id_nonnullable.rb
new file mode 100644
index 000000000..4eecb6154
--- /dev/null
+++ b/db/migrate/20180206000000_change_user_id_nonnullable.rb
@@ -0,0 +1,6 @@
+class ChangeUserIdNonnullable < ActiveRecord::Migration[5.1]
+  def change
+    change_column_null :invites, :user_id, false
+    change_column_null :web_settings, :user_id, false
+  end
+end
diff --git a/db/migrate/20180211015820_create_backups.rb b/db/migrate/20180211015820_create_backups.rb
new file mode 100644
index 000000000..9725a3e9f
--- /dev/null
+++ b/db/migrate/20180211015820_create_backups.rb
@@ -0,0 +1,11 @@
+class CreateBackups < ActiveRecord::Migration[5.1]
+  def change
+    create_table :backups do |t|
+      t.references :user, foreign_key: { on_delete: :nullify }
+      t.attachment :dump
+      t.boolean :processed, null: false, default: false
+
+      t.timestamps
+    end
+  end
+end
diff --git a/db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb b/db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb
new file mode 100644
index 000000000..e0b8ed5cc
--- /dev/null
+++ b/db/migrate/20180304013859_add_featured_collection_url_to_accounts.rb
@@ -0,0 +1,5 @@
+class AddFeaturedCollectionUrlToAccounts < ActiveRecord::Migration[5.1]
+  def change
+    add_column :accounts, :featured_collection_url, :string
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 11ca12235..70420d396 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20180106000232) do
+ActiveRecord::Schema.define(version: 20180304013859) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -73,6 +73,7 @@ ActiveRecord::Schema.define(version: 20180106000232) do
     t.integer "protocol", default: 0, null: false
     t.boolean "memorial", default: false, null: false
     t.bigint "moved_to_account_id"
+    t.string "featured_collection_url"
     t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin
     t.index "lower((username)::text), lower((domain)::text)", name: "index_accounts_on_username_and_domain_lower"
     t.index ["uri"], name: "index_accounts_on_uri"
@@ -92,6 +93,18 @@ ActiveRecord::Schema.define(version: 20180106000232) do
     t.index ["target_type", "target_id"], name: "index_admin_action_logs_on_target_type_and_target_id"
   end
 
+  create_table "backups", force: :cascade do |t|
+    t.bigint "user_id"
+    t.string "dump_file_name"
+    t.string "dump_content_type"
+    t.integer "dump_file_size"
+    t.datetime "dump_updated_at"
+    t.boolean "processed", default: false, null: false
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["user_id"], name: "index_backups_on_user_id"
+  end
+
   create_table "blocks", force: :cascade do |t|
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
@@ -182,6 +195,15 @@ ActiveRecord::Schema.define(version: 20180106000232) do
     t.index ["account_id"], name: "index_glitch_keyword_mutes_on_account_id"
   end
 
+  create_table "identities", id: :serial, force: :cascade do |t|
+    t.integer "user_id"
+    t.string "provider", default: "", null: false
+    t.string "uid", default: "", null: false
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["user_id"], name: "index_identities_on_user_id"
+  end
+
   create_table "imports", force: :cascade do |t|
     t.integer "type", null: false
     t.boolean "approved", default: false, null: false
@@ -195,7 +217,7 @@ ActiveRecord::Schema.define(version: 20180106000232) do
   end
 
   create_table "invites", force: :cascade do |t|
-    t.bigint "user_id"
+    t.bigint "user_id", null: false
     t.string "code", default: "", null: false
     t.datetime "expires_at"
     t.integer "max_uses"
@@ -496,6 +518,7 @@ ActiveRecord::Schema.define(version: 20180106000232) do
     t.boolean "disabled", default: false, null: false
     t.boolean "moderator", default: false, null: false
     t.bigint "invite_id"
+    t.string "remember_token"
     t.index ["account_id"], name: "index_users_on_account_id"
     t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
     t.index ["email"], name: "index_users_on_email", unique: true
@@ -516,7 +539,7 @@ ActiveRecord::Schema.define(version: 20180106000232) do
     t.json "data"
     t.datetime "created_at", null: false
     t.datetime "updated_at", null: false
-    t.bigint "user_id"
+    t.bigint "user_id", null: false
     t.index ["user_id"], name: "index_web_settings_on_user_id", unique: true
   end
 
@@ -525,6 +548,7 @@ ActiveRecord::Schema.define(version: 20180106000232) do
   add_foreign_key "account_moderation_notes", "accounts", column: "target_account_id"
   add_foreign_key "accounts", "accounts", column: "moved_to_account_id", on_delete: :nullify
   add_foreign_key "admin_action_logs", "accounts", on_delete: :cascade
+  add_foreign_key "backups", "users", on_delete: :nullify
   add_foreign_key "blocks", "accounts", column: "target_account_id", name: "fk_9571bfabc1", on_delete: :cascade
   add_foreign_key "blocks", "accounts", name: "fk_4269e03e65", on_delete: :cascade
   add_foreign_key "conversation_mutes", "accounts", name: "fk_225b4212bb", on_delete: :cascade
@@ -536,6 +560,7 @@ ActiveRecord::Schema.define(version: 20180106000232) do
   add_foreign_key "follows", "accounts", column: "target_account_id", name: "fk_745ca29eac", on_delete: :cascade
   add_foreign_key "follows", "accounts", name: "fk_32ed1b5560", on_delete: :cascade
   add_foreign_key "glitch_keyword_mutes", "accounts", on_delete: :cascade
+  add_foreign_key "identities", "users", on_delete: :cascade
   add_foreign_key "imports", "accounts", name: "fk_6db1b6e408", on_delete: :cascade
   add_foreign_key "invites", "users", on_delete: :cascade
   add_foreign_key "list_accounts", "accounts", on_delete: :cascade