From 9c4856bdb11fc9311ab30a97224cee3dfaec492f Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 20 Feb 2016 22:53:20 +0100 Subject: Initial commit --- db/migrate/20160220174730_create_accounts.rb | 25 +++++++++++++++++++++++++ db/migrate/20160220211917_create_statuses.rb | 13 +++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 db/migrate/20160220174730_create_accounts.rb create mode 100644 db/migrate/20160220211917_create_statuses.rb (limited to 'db/migrate') diff --git a/db/migrate/20160220174730_create_accounts.rb b/db/migrate/20160220174730_create_accounts.rb new file mode 100644 index 000000000..65c15f3e8 --- /dev/null +++ b/db/migrate/20160220174730_create_accounts.rb @@ -0,0 +1,25 @@ +class CreateAccounts < ActiveRecord::Migration + def change + create_table :accounts do |t| + t.string :username, null: false, default: '' + t.string :domain, null: true + + # PuSH credentials + t.string :verify_token, null: false, default: '' + t.string :secret, null: false, default: '' + + # RSA key pair + t.text :private_key, null: true + t.text :public_key, null: false, default: '' + + # URLs + t.string :remote_url, null: false, default: '' + t.string :salmon_url, null: false, default: '' + t.string :hub_url, null: false, default: '' + + t.timestamps null: false + end + + add_index :accounts, [:username, :domain], unique: true + end +end diff --git a/db/migrate/20160220211917_create_statuses.rb b/db/migrate/20160220211917_create_statuses.rb new file mode 100644 index 000000000..5e62e95be --- /dev/null +++ b/db/migrate/20160220211917_create_statuses.rb @@ -0,0 +1,13 @@ +class CreateStatuses < ActiveRecord::Migration + def change + create_table :statuses do |t| + t.string :uri, null: false, default: '' + t.integer :account_id, null: false + t.text :text, null: false, default: '' + + t.timestamps null: false + end + + add_index :statuses, :uri, unique: true + end +end -- cgit