about summary refs log tree commit diff
path: root/db
diff options
context:
space:
mode:
authorAnthony Bellew <anthonyreflected@gmail.com>2017-01-25 20:53:57 -0700
committerGitHub <noreply@github.com>2017-01-25 20:53:57 -0700
commit3d890c407356c8e0e7dd9b64e8e232ededcff8e8 (patch)
treea22df9a8737250f97a6024943af3445a163917b3 /db
parentfebe2449bb14f3d877fb934ceb6d52e320712bac (diff)
parent905c82917959a5afe24cb85c62c0b0ba13f0da8b (diff)
Merge pull request #3 from tootsuite/master
Updating to current
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20170105224407_add_shortcode_to_media_attachments.rb14
-rw-r--r--db/migrate/20170109120109_create_web_settings.rb12
-rw-r--r--db/migrate/20170112154826_migrate_settings.rb19
-rw-r--r--db/migrate/20170114194937_add_application_to_statuses.rb5
-rw-r--r--db/migrate/20170114203041_add_website_to_oauth_application.rb5
-rw-r--r--db/migrate/20170119214911_create_preview_cards.rb17
-rw-r--r--db/migrate/20170123162658_add_severity_to_domain_blocks.rb5
-rw-r--r--db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb5
-rw-r--r--db/migrate/20170125145934_add_spoiler_text_to_statuses.rb5
-rw-r--r--db/schema.rb55
10 files changed, 122 insertions, 20 deletions
diff --git a/db/migrate/20170105224407_add_shortcode_to_media_attachments.rb b/db/migrate/20170105224407_add_shortcode_to_media_attachments.rb
new file mode 100644
index 000000000..2685ae150
--- /dev/null
+++ b/db/migrate/20170105224407_add_shortcode_to_media_attachments.rb
@@ -0,0 +1,14 @@
+class AddShortcodeToMediaAttachments < ActiveRecord::Migration[5.0]
+  def up
+    add_column :media_attachments, :shortcode, :string, null: true, default: nil
+    add_index :media_attachments, :shortcode, unique: true
+
+    # Migrate old links
+    MediaAttachment.local.update_all('shortcode = id')
+  end
+
+  def down
+  	remove_index :media_attachments, :shortcode
+  	remove_column :media_attachments, :shortcode
+  end
+end
diff --git a/db/migrate/20170109120109_create_web_settings.rb b/db/migrate/20170109120109_create_web_settings.rb
new file mode 100644
index 000000000..2aeae1f91
--- /dev/null
+++ b/db/migrate/20170109120109_create_web_settings.rb
@@ -0,0 +1,12 @@
+class CreateWebSettings < ActiveRecord::Migration[5.0]
+  def change
+    create_table :web_settings do |t|
+      t.integer :user_id
+      t.json :data
+
+      t.timestamps
+    end
+
+    add_index :web_settings, :user_id, unique: true
+  end
+end
diff --git a/db/migrate/20170112154826_migrate_settings.rb b/db/migrate/20170112154826_migrate_settings.rb
new file mode 100644
index 000000000..f6f6ed531
--- /dev/null
+++ b/db/migrate/20170112154826_migrate_settings.rb
@@ -0,0 +1,19 @@
+class MigrateSettings < ActiveRecord::Migration
+  def up
+    remove_index :settings, [:target_type, :target_id, :var]
+    rename_column :settings, :target_id, :thing_id
+    rename_column :settings, :target_type, :thing_type
+    change_column :settings, :thing_id, :integer, null: true, default: nil
+    change_column :settings, :thing_type, :string, null: true, default: nil
+    add_index :settings, [:thing_type, :thing_id, :var], unique: true
+  end
+
+  def down
+    remove_index :settings, [:thing_type, :thing_id, :var]
+    rename_column :settings, :thing_id, :target_id
+    rename_column :settings, :thing_type, :target_type
+    change_column :settings, :target_id, :integer, null: false
+    change_column :settings, :target_type, :string, null: false, default: ''
+    add_index :settings, [:target_type, :target_id, :var], unique: true
+  end
+end
diff --git a/db/migrate/20170114194937_add_application_to_statuses.rb b/db/migrate/20170114194937_add_application_to_statuses.rb
new file mode 100644
index 000000000..b699db2ac
--- /dev/null
+++ b/db/migrate/20170114194937_add_application_to_statuses.rb
@@ -0,0 +1,5 @@
+class AddApplicationToStatuses < ActiveRecord::Migration[5.0]
+  def change
+    add_column :statuses, :application_id, :int
+  end
+end
diff --git a/db/migrate/20170114203041_add_website_to_oauth_application.rb b/db/migrate/20170114203041_add_website_to_oauth_application.rb
new file mode 100644
index 000000000..ee674be72
--- /dev/null
+++ b/db/migrate/20170114203041_add_website_to_oauth_application.rb
@@ -0,0 +1,5 @@
+class AddWebsiteToOauthApplication < ActiveRecord::Migration[5.0]
+  def change
+    add_column :oauth_applications, :website, :string
+  end
+end
diff --git a/db/migrate/20170119214911_create_preview_cards.rb b/db/migrate/20170119214911_create_preview_cards.rb
new file mode 100644
index 000000000..70ed91bbd
--- /dev/null
+++ b/db/migrate/20170119214911_create_preview_cards.rb
@@ -0,0 +1,17 @@
+class CreatePreviewCards < ActiveRecord::Migration[5.0]
+  def change
+    create_table :preview_cards do |t|
+      t.integer :status_id
+      t.string :url, null: false, default: ''
+
+      # OpenGraph
+      t.string :title, null: true
+      t.string :description, null: true
+      t.attachment :image
+
+      t.timestamps
+    end
+
+    add_index :preview_cards, :status_id, unique: true
+  end
+end
diff --git a/db/migrate/20170123162658_add_severity_to_domain_blocks.rb b/db/migrate/20170123162658_add_severity_to_domain_blocks.rb
new file mode 100644
index 000000000..dcbc32a1a
--- /dev/null
+++ b/db/migrate/20170123162658_add_severity_to_domain_blocks.rb
@@ -0,0 +1,5 @@
+class AddSeverityToDomainBlocks < ActiveRecord::Migration[5.0]
+  def change
+    add_column :domain_blocks, :severity, :integer, default: 0
+  end
+end
diff --git a/db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb b/db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb
new file mode 100644
index 000000000..999fccda0
--- /dev/null
+++ b/db/migrate/20170123203248_add_reject_media_to_domain_blocks.rb
@@ -0,0 +1,5 @@
+class AddRejectMediaToDomainBlocks < ActiveRecord::Migration[5.0]
+  def change
+    add_column :domain_blocks, :reject_media, :boolean
+  end
+end
diff --git a/db/migrate/20170125145934_add_spoiler_text_to_statuses.rb b/db/migrate/20170125145934_add_spoiler_text_to_statuses.rb
new file mode 100644
index 000000000..2c43210ba
--- /dev/null
+++ b/db/migrate/20170125145934_add_spoiler_text_to_statuses.rb
@@ -0,0 +1,5 @@
+class AddSpoilerTextToStatuses < ActiveRecord::Migration[5.0]
+  def change
+    add_column :statuses, :spoiler_text, :text, default: "", null: false
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b9236d42f..72ce63133 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: 20161222204147) do
+ActiveRecord::Schema.define(version: 20170125145934) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -55,9 +55,11 @@ ActiveRecord::Schema.define(version: 20161222204147) do
   end
 
   create_table "domain_blocks", force: :cascade do |t|
-    t.string   "domain",     default: "", null: false
-    t.datetime "created_at",              null: false
-    t.datetime "updated_at",              null: false
+    t.string   "domain",       default: "", null: false
+    t.datetime "created_at",                null: false
+    t.datetime "updated_at",                null: false
+    t.integer  "severity",     default: 0
+    t.boolean  "reject_media"
     t.index ["domain"], name: "index_domain_blocks_on_domain", unique: true, using: :btree
   end
 
@@ -95,6 +97,8 @@ ActiveRecord::Schema.define(version: 20161222204147) do
     t.integer  "account_id"
     t.datetime "created_at",                     null: false
     t.datetime "updated_at",                     null: false
+    t.string   "shortcode"
+    t.index ["shortcode"], name: "index_media_attachments_on_shortcode", unique: true, using: :btree
     t.index ["status_id"], name: "index_media_attachments_on_status_id", using: :btree
   end
 
@@ -151,30 +155,32 @@ ActiveRecord::Schema.define(version: 20161222204147) do
     t.datetime "created_at"
     t.datetime "updated_at"
     t.boolean  "superapp",     default: false, null: false
+    t.string   "website"
     t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree
   end
 
-  create_table "pubsubhubbub_subscriptions", force: :cascade do |t|
-    t.string   "topic",      default: "",    null: false
-    t.string   "callback",   default: "",    null: false
-    t.string   "mode",       default: "",    null: false
-    t.string   "challenge",  default: "",    null: false
-    t.string   "secret"
-    t.boolean  "confirmed",  default: false, null: false
-    t.datetime "expires_at",                 null: false
-    t.datetime "created_at",                 null: false
-    t.datetime "updated_at",                 null: false
-    t.index ["topic", "callback"], name: "index_pubsubhubbub_subscriptions_on_topic_and_callback", unique: true, using: :btree
+  create_table "preview_cards", force: :cascade do |t|
+    t.integer  "status_id"
+    t.string   "url",                default: "", null: false
+    t.string   "title"
+    t.string   "description"
+    t.string   "image_file_name"
+    t.string   "image_content_type"
+    t.integer  "image_file_size"
+    t.datetime "image_updated_at"
+    t.datetime "created_at",                      null: false
+    t.datetime "updated_at",                      null: false
+    t.index ["status_id"], name: "index_preview_cards_on_status_id", unique: true, using: :btree
   end
 
   create_table "settings", force: :cascade do |t|
-    t.string   "var",         null: false
+    t.string   "var",        null: false
     t.text     "value"
-    t.string   "target_type", null: false
-    t.integer  "target_id",   null: false
+    t.string   "thing_type"
+    t.integer  "thing_id"
     t.datetime "created_at"
     t.datetime "updated_at"
-    t.index ["target_type", "target_id", "var"], name: "index_settings_on_target_type_and_target_id_and_var", unique: true, using: :btree
+    t.index ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true, using: :btree
   end
 
   create_table "statuses", force: :cascade do |t|
@@ -189,7 +195,8 @@ ActiveRecord::Schema.define(version: 20161222204147) do
     t.boolean  "sensitive",              default: false
     t.integer  "visibility",             default: 0,     null: false
     t.integer  "in_reply_to_account_id"
-    t.string   "conversation_uri"
+    t.integer  "application_id"
+    t.text     "spoiler_text",           default: "",    null: false
     t.index ["account_id"], name: "index_statuses_on_account_id", using: :btree
     t.index ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id", using: :btree
     t.index ["reblog_of_id"], name: "index_statuses_on_reblog_of_id", using: :btree
@@ -258,4 +265,12 @@ ActiveRecord::Schema.define(version: 20161222204147) do
     t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
   end
 
+  create_table "web_settings", force: :cascade do |t|
+    t.integer  "user_id"
+    t.json     "data"
+    t.datetime "created_at", null: false
+    t.datetime "updated_at", null: false
+    t.index ["user_id"], name: "index_web_settings_on_user_id", unique: true, using: :btree
+  end
+
 end