Sha256: ad93e838b6ebd007610645f6f9a531217556f918899f93d8dd4694a9d188934f

Contents?: true

Size: 635 Bytes

Versions: 66

Compression:

Stored size: 635 Bytes

Contents

class CreateFeatures < ActiveRecord::Migration[5.0]
  
  def change
    create_table(:features) do |t|
      t.string :name
      t.string :status, :null => false, :default=>"unpublished", :limit=>16
      t.timestamps
    end

    create_table :permissions do |t|
      t.belongs_to :user, index: true
      t.belongs_to :feature, index: true
      t.boolean :can_create, default: false
      t.boolean :can_read, default: true
      t.boolean :can_update, default: false
      t.boolean :can_delete, default: false
      
      t.timestamps
    end

    add_index(:permissions, [ :user_id, :feature_id ], :unique => true)
  end

end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
usman-0.4.10.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.9.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.8.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.7.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.6.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.5.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.4.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.3.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.2.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.1.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.4.0.pre.materialize db/migrate/20170000000101_create_features.rb
usman-0.3.38 db/migrate/20170000000101_create_features.rb
usman-0.3.37 db/migrate/20170000000101_create_features.rb
usman-0.3.36 db/migrate/20170000000101_create_features.rb
usman-0.3.35 db/migrate/20170000000101_create_features.rb
usman-0.3.34 db/migrate/20170000000101_create_features.rb
usman-0.3.33 db/migrate/20170000000101_create_features.rb
usman-0.3.32 db/migrate/20170000000101_create_features.rb
usman-0.3.31 db/migrate/20170000000101_create_features.rb
usman-0.3.30 db/migrate/20170000000101_create_features.rb