From ae1fac006206ab28cd7cba63ab85c07a27f3d606 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 5 Sep 2016 17:46:36 +0200 Subject: Add API to upload media attachments --- db/migrate/20160905150353_create_media_attachments.rb | 14 ++++++++++++++ db/schema.rb | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20160905150353_create_media_attachments.rb (limited to 'db') diff --git a/db/migrate/20160905150353_create_media_attachments.rb b/db/migrate/20160905150353_create_media_attachments.rb new file mode 100644 index 000000000..32d0897d8 --- /dev/null +++ b/db/migrate/20160905150353_create_media_attachments.rb @@ -0,0 +1,14 @@ +class CreateMediaAttachments < ActiveRecord::Migration[5.0] + def change + create_table :media_attachments do |t| + t.integer :status_id, null: true, default: nil + t.attachment :file + t.string :remote_url, null: false, default: '' + t.integer :account_id + + t.timestamps + end + + add_index :media_attachments, :status_id + end +end diff --git a/db/schema.rb b/db/schema.rb index b63df0fea..4a3078e64 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: 20160826155805) do +ActiveRecord::Schema.define(version: 20160905150353) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -59,6 +59,19 @@ ActiveRecord::Schema.define(version: 20160826155805) do t.index ["account_id", "target_account_id"], name: "index_follows_on_account_id_and_target_account_id", unique: true, using: :btree end + create_table "media_attachments", force: :cascade do |t| + t.integer "status_id" + t.string "file_file_name" + t.string "file_content_type" + t.integer "file_file_size" + t.datetime "file_updated_at" + t.string "remote_url", default: "", null: false + t.integer "account_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["status_id"], name: "index_media_attachments_on_status_id", using: :btree + end + create_table "mentions", force: :cascade do |t| t.integer "account_id" t.integer "status_id" -- cgit