Class: CreateVoynichTables

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/voynich/templates/migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/voynich/templates/migration.rb', line 2

def change
  create_table(:voynich_data_keys) do |t|
    t.string :name, null: false
    t.string :cmk_id, null: false
    t.text :ciphertext, null: false
  end

  create_table(:voynich_values) do |t|
    t.references :data_key, index: true, null: false
    t.string :uuid, null: false
    t.text :ciphertext, null: false
  end

  add_index :voynich_data_keys, :name, unique: true
  add_index :voynich_values, :uuid, unique: true
end