mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
Model for subscriptions #migration
This commit is contained in:
parent
0434242a94
commit
1ec58d3b7b
4
app/models/subscription.rb
Normal file
4
app/models/subscription.rb
Normal file
@ -0,0 +1,4 @@
|
||||
class Subscription < ActiveRecord::Base
|
||||
belongs_to :user
|
||||
belongs_to :billing_plan
|
||||
end
|
||||
12
db/migrate/20170120214721_create_subscriptions.rb
Normal file
12
db/migrate/20170120214721_create_subscriptions.rb
Normal file
@ -0,0 +1,12 @@
|
||||
class CreateSubscriptions < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :subscriptions do |t|
|
||||
t.references :user, index: true, foreign_key: true
|
||||
t.references :billing_plan, index: true, foreign_key: true
|
||||
t.datetime :start_date
|
||||
t.datetime :end_date
|
||||
|
||||
t.timestamps null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/schema.rb
14
db/schema.rb
@ -11,7 +11,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20170120214443) do
|
||||
ActiveRecord::Schema.define(version: 20170120214721) do
|
||||
|
||||
create_table "archenemyships", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
@ -615,6 +615,18 @@ ActiveRecord::Schema.define(version: 20170120214443) do
|
||||
t.integer "subgroup_id"
|
||||
end
|
||||
|
||||
create_table "subscriptions", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "billing_plan_id"
|
||||
t.datetime "start_date"
|
||||
t.datetime "end_date"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
add_index "subscriptions", ["billing_plan_id"], name: "index_subscriptions_on_billing_plan_id"
|
||||
add_index "subscriptions", ["user_id"], name: "index_subscriptions_on_user_id"
|
||||
|
||||
create_table "supergroupships", force: :cascade do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "group_id"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user