mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-21 06:24:22 -04:00
seed account types; require name too
This commit is contained in:
1 parent
871229ed2b
commit
daa46d7acb
3 files changed
+33
-2
No files matched your search
@@ -0,0 +1,9 @@
|
||||
class RequireAccountTypeName < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :account_types, :name, :string, :null => false
|
||||
end
|
||||
|
||||
def down
|
||||
change_column :account_types, :name, :string, :null => true
|
||||
end
|
||||
end
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20130517051922) do
|
||||
ActiveRecord::Schema.define(:version => 20130517234458) do
|
||||
|
||||
create_table "account_details", :force => true do |t|
|
||||
t.integer "member_id", :null => false
|
||||
@@ -22,7 +22,7 @@ ActiveRecord::Schema.define(:version => 20130517051922) do
|
||||
end
|
||||
|
||||
create_table "account_types", :force => true do |t|
|
||||
t.string "name"
|
||||
t.string "name", :null => false
|
||||
t.boolean "is_paid"
|
||||
t.boolean "is_permanent_paid"
|
||||
t.datetime "created_at", :null => false
|
||||
|
||||
+22
@@ -58,6 +58,28 @@ if Rails.env.development? or Rails.env.test?
|
||||
@wrangler_user.roles << @wrangler
|
||||
@wrangler_user.save!
|
||||
|
||||
puts "Adding account types..."
|
||||
AccountType.create!(
|
||||
:name => "Free",
|
||||
:is_paid => false,
|
||||
:is_permanent_paid => false
|
||||
)
|
||||
AccountType.create!(
|
||||
:name => "Paid",
|
||||
:is_paid => true,
|
||||
:is_permanent_paid => false
|
||||
)
|
||||
AccountType.create!(
|
||||
:name => "Seed",
|
||||
:is_paid => true,
|
||||
:is_permanent_paid => true
|
||||
)
|
||||
AccountType.create!(
|
||||
:name => "Staff",
|
||||
:is_paid => true,
|
||||
:is_permanent_paid => true
|
||||
)
|
||||
|
||||
puts "Adding products..."
|
||||
Product.create!(
|
||||
:name => "Annual subscription",
|
||||
|
||||
Reference in new issue
Block a user