20160220174730_create_accounts.rb 702 B

12345678910111213141516171819202122232425
  1. class CreateAccounts < ActiveRecord::Migration
  2. def change
  3. create_table :accounts do |t|
  4. t.string :username, null: false, default: ''
  5. t.string :domain, null: true
  6. # PuSH credentials
  7. t.string :verify_token, null: false, default: ''
  8. t.string :secret, null: false, default: ''
  9. # RSA key pair
  10. t.text :private_key, null: true
  11. t.text :public_key, null: false, default: ''
  12. # URLs
  13. t.string :remote_url, null: false, default: ''
  14. t.string :salmon_url, null: false, default: ''
  15. t.string :hub_url, null: false, default: ''
  16. t.timestamps null: false
  17. end
  18. add_index :accounts, [:username, :domain], unique: true
  19. end
  20. end