Sha256: 314858cbc4c63104941106131679535a02ed2902bc90b17c31cec6f2a94e1746
Contents?: true
Size: 1.18 KB
Versions: 3
Compression:
Stored size: 1.18 KB
Contents
class CreateAdminpanelTables < ActiveRecord::Migration def migrate(direction) super # Create a default user if direction == :up if Rails.env.development? Adminpanel::User.new(:email => 'admin@admin.com', :name => "Admin", :password => 'password', :password_confirmation => 'password').save puts "The password for admin@admin.com is: password" end end end def change create_table :adminpanel_users do |t| t.string :name t.string :email t.string :password_digest t.string :remember_token t.timestamps end add_index :adminpanel_users, [:email] add_index :adminpanel_users, [:remember_token] create_table :adminpanel_galleries do |t| t.string :file t.integer :position t.timestamps end create_table :adminpanel_images do |t| t.string :file t.integer :section_id t.timestamps end create_table :adminpanel_sections do |t| t.string :name t.boolean :has_description t.text :description t.string :key t.string :page t.boolean :has_image t.timestamps end add_index :adminpanel_sections, [:key] end end
Version data entries
3 entries across 3 versions & 1 rubygems