about summary refs log tree commit diff
path: root/db/migrate/20160220174730_create_accounts.rb
blob: 65c15f3e8a90a82b6b55499c083cad03fe361128 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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