Initial commit
This commit is contained in:
		
						commit
						9c4856bdb1
					
				
					 73 changed files with 1393 additions and 0 deletions
				
			
		
							
								
								
									
										25
									
								
								db/migrate/20160220174730_create_accounts.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								db/migrate/20160220174730_create_accounts.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
							
								
								
									
										13
									
								
								db/migrate/20160220211917_create_statuses.rb
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								db/migrate/20160220211917_create_statuses.rb
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
		Reference in a new issue