20160220174730_create_accounts.rb 738 B

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