diff options
author | kibigo! <marrus-sh@users.noreply.github.com> | 2017-07-15 14:33:15 -0700 |
---|---|---|
committer | kibigo! <marrus-sh@users.noreply.github.com> | 2017-07-15 14:33:15 -0700 |
commit | 09cfc079b0958c42fe619e2d88c3f9fd1d7c7900 (patch) | |
tree | 156de790a5bec0fdf050e392bee8a64b220d3a9d /db | |
parent | 08d021916db9e350259b925d7e562aa13ba37422 (diff) | |
parent | 695439775eacea081c7257aabab39d0ec6b492dc (diff) |
Merge upstream (#81)
Diffstat (limited to 'db')
6 files changed, 69 insertions, 8 deletions
diff --git a/db/migrate/20170711225116_fix_null_booleans.rb b/db/migrate/20170711225116_fix_null_booleans.rb new file mode 100644 index 000000000..5b319471d --- /dev/null +++ b/db/migrate/20170711225116_fix_null_booleans.rb @@ -0,0 +1,17 @@ +class FixNullBooleans < ActiveRecord::Migration[5.1] + def change + change_column_default :domain_blocks, :reject_media, false + change_column_null :domain_blocks, :reject_media, false, false + + change_column_default :imports, :approved, false + change_column_null :imports, :approved, false, false + + change_column_null :statuses, :sensitive, false, false + change_column_null :statuses, :reply, false, false + + change_column_null :users, :admin, false, false + + change_column_default :users, :otp_required_for_login, false + change_column_null :users, :otp_required_for_login, false, false + end +end diff --git a/db/migrate/20170713112503_make_tag_search_case_insensitive.rb b/db/migrate/20170713112503_make_tag_search_case_insensitive.rb new file mode 100644 index 000000000..33ed6c005 --- /dev/null +++ b/db/migrate/20170713112503_make_tag_search_case_insensitive.rb @@ -0,0 +1,11 @@ +class MakeTagSearchCaseInsensitive < ActiveRecord::Migration[5.1] + def up + remove_index :tags, name: :hashtag_search_index + execute 'CREATE INDEX hashtag_search_index ON tags (lower(name) text_pattern_ops);' + end + + def down + remove_index :tags, name: :hashtag_search_index + execute 'CREATE INDEX hashtag_search_index ON tags (name text_pattern_ops);' + end +end diff --git a/db/migrate/20170713175513_create_web_push_subscriptions.rb b/db/migrate/20170713175513_create_web_push_subscriptions.rb new file mode 100644 index 000000000..4e5c2ba00 --- /dev/null +++ b/db/migrate/20170713175513_create_web_push_subscriptions.rb @@ -0,0 +1,12 @@ +class CreateWebPushSubscriptions < ActiveRecord::Migration[5.1] + def change + create_table :web_push_subscriptions do |t| + t.string :endpoint, null: false + t.string :key_p256dh, null: false + t.string :key_auth, null: false + t.json :data + + t.timestamps + end + end +end diff --git a/db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb b/db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb new file mode 100644 index 000000000..d69cdfa50 --- /dev/null +++ b/db/migrate/20170713190709_add_web_push_subscription_to_session_activations.rb @@ -0,0 +1,5 @@ +class AddWebPushSubscriptionToSessionActivations < ActiveRecord::Migration[5.1] + def change + add_column :session_activations, :web_push_subscription_id, :integer + end +end diff --git a/db/migrate/20170714184731_add_domain_to_subscriptions.rb b/db/migrate/20170714184731_add_domain_to_subscriptions.rb new file mode 100644 index 000000000..7c01a64f5 --- /dev/null +++ b/db/migrate/20170714184731_add_domain_to_subscriptions.rb @@ -0,0 +1,5 @@ +class AddDomainToSubscriptions < ActiveRecord::Migration[5.1] + def change + add_column :subscriptions, :domain, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 159704c6a..5ec78a7c9 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: 20170625140443) do +ActiveRecord::Schema.define(version: 20170714184731) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -89,7 +89,7 @@ ActiveRecord::Schema.define(version: 20170625140443) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "severity", default: 0 - t.boolean "reject_media" + t.boolean "reject_media", default: false, null: false t.index ["domain"], name: "index_domain_blocks_on_domain", unique: true end @@ -121,7 +121,7 @@ ActiveRecord::Schema.define(version: 20170625140443) do create_table "imports", id: :serial, force: :cascade do |t| t.integer "account_id", null: false t.integer "type", null: false - t.boolean "approved" + t.boolean "approved", default: false, null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "data_file_name" @@ -258,6 +258,7 @@ ActiveRecord::Schema.define(version: 20170625140443) do t.string "user_agent", default: "", null: false t.inet "ip" t.integer "access_token_id" + t.integer "web_push_subscription_id" t.index ["session_id"], name: "index_session_activations_on_session_id", unique: true t.index ["user_id"], name: "index_session_activations_on_user_id" end @@ -281,12 +282,12 @@ ActiveRecord::Schema.define(version: 20170625140443) do t.bigint "in_reply_to_id" t.bigint "reblog_of_id" t.string "url" - t.boolean "sensitive", default: false + t.boolean "sensitive", default: false, null: false t.integer "visibility", default: 0, null: false t.integer "in_reply_to_account_id" t.integer "application_id" t.text "spoiler_text", default: "", null: false - t.boolean "reply", default: false + t.boolean "reply", default: false, null: false t.integer "favourites_count", default: 0, null: false t.integer "reblogs_count", default: 0, null: false t.string "language" @@ -325,6 +326,7 @@ ActiveRecord::Schema.define(version: 20170625140443) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.datetime "last_successful_delivery_at" + t.string "domain" t.index ["account_id", "callback_url"], name: "index_subscriptions_on_account_id_and_callback_url", unique: true end @@ -332,7 +334,7 @@ ActiveRecord::Schema.define(version: 20170625140443) do t.string "name", default: "", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index "name text_pattern_ops", name: "hashtag_search_index" + t.index "lower((name)::text) text_pattern_ops", name: "hashtag_search_index" t.index ["name"], name: "index_tags_on_name", unique: true end @@ -350,7 +352,7 @@ ActiveRecord::Schema.define(version: 20170625140443) do t.datetime "last_sign_in_at" t.inet "current_sign_in_ip" t.inet "last_sign_in_ip" - t.boolean "admin", default: false + t.boolean "admin", default: false, null: false t.string "confirmation_token" t.datetime "confirmed_at" t.datetime "confirmation_sent_at" @@ -360,7 +362,7 @@ ActiveRecord::Schema.define(version: 20170625140443) do t.string "encrypted_otp_secret_iv" t.string "encrypted_otp_secret_salt" t.integer "consumed_timestep" - t.boolean "otp_required_for_login" + t.boolean "otp_required_for_login", default: false, null: false t.datetime "last_emailed_at" t.string "otp_backup_codes", array: true t.string "filtered_languages", default: [], null: false, array: true @@ -371,6 +373,15 @@ ActiveRecord::Schema.define(version: 20170625140443) do t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end + create_table "web_push_subscriptions", force: :cascade do |t| + t.string "endpoint", null: false + t.string "key_p256dh", null: false + t.string "key_auth", null: false + t.json "data" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "web_settings", id: :serial, force: :cascade do |t| t.integer "user_id" t.json "data" |