~cytrogen/masto-fe

ref: bb98d970e3f3333f85d454bc1fd26a1b582b14d2 masto-fe/db/migrate/20160220174730_create_accounts.rb -rw-r--r-- 738 bytes
bb98d970 — Claire Merge pull request #2291 from ClearlyClaire/glitch-soc/merge-upstream 2 years ago
                                                                                
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
26
27
# frozen_string_literal: true

class CreateAccounts < ActiveRecord::Migration[4.2]
  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