2015-05-05 03:10:25 +02:00
|
|
|
# encoding: UTF-8
|
|
|
|
# This file is auto-generated from the current state of the database. Instead
|
|
|
|
# of editing this file, please use the migrations feature of Active Record to
|
|
|
|
# incrementally modify your database, and then regenerate this schema definition.
|
|
|
|
#
|
|
|
|
# Note that this schema.rb definition is the authoritative source for your
|
|
|
|
# database schema. If you need to create the application database on another
|
|
|
|
# system, you should be using db:schema:load, not running all the migrations
|
|
|
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
|
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
|
|
#
|
|
|
|
# It's strongly recommended that you check this file into your version control system.
|
|
|
|
|
2016-09-15 15:58:21 +02:00
|
|
|
ActiveRecord::Schema.define(version: 20160915105234) do
|
2015-05-05 03:10:25 +02:00
|
|
|
|
|
|
|
# These are extensions that must be enabled in order to support this database
|
|
|
|
enable_extension "plpgsql"
|
2016-06-14 09:57:39 +02:00
|
|
|
enable_extension "unaccent"
|
|
|
|
enable_extension "pg_trgm"
|
2015-05-05 03:10:25 +02:00
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "abuses", force: :cascade do |t|
|
|
|
|
t.integer "signaled_id"
|
|
|
|
t.string "signaled_type"
|
|
|
|
t.string "first_name"
|
|
|
|
t.string "last_name"
|
|
|
|
t.string "email"
|
|
|
|
t.text "message"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "abuses", ["signaled_type", "signaled_id"], name: "index_abuses_on_signaled_type_and_signaled_id", using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "addresses", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "address", limit: 255
|
|
|
|
t.string "street_number", limit: 255
|
|
|
|
t.string "route", limit: 255
|
|
|
|
t.string "locality", limit: 255
|
|
|
|
t.string "country", limit: 255
|
|
|
|
t.string "postal_code", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "placeable_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "placeable_type", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
2016-07-13 16:15:50 +02:00
|
|
|
create_table "age_ranges", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "slug"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "age_ranges", ["slug"], name: "index_age_ranges_on_slug", unique: true, using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "assets", force: :cascade do |t|
|
|
|
|
t.integer "viewable_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "viewable_type", limit: 255
|
|
|
|
t.string "attachment", limit: 255
|
|
|
|
t.string "type", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "auth_providers", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.string "status"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "providable_type"
|
|
|
|
t.integer "providable_id"
|
|
|
|
end
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "availabilities", force: :cascade do |t|
|
|
|
|
t.datetime "start_at"
|
|
|
|
t.datetime "end_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "available_type", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "nb_total_places"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.boolean "destroying", default: false
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "availability_tags", force: :cascade do |t|
|
|
|
|
t.integer "availability_id"
|
|
|
|
t.integer "tag_id"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "availability_tags", ["availability_id"], name: "index_availability_tags_on_availability_id", using: :btree
|
|
|
|
add_index "availability_tags", ["tag_id"], name: "index_availability_tags_on_tag_id", using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "categories", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-07-13 16:15:50 +02:00
|
|
|
t.string "slug"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2016-07-13 16:15:50 +02:00
|
|
|
add_index "categories", ["slug"], name: "index_categories_on_slug", unique: true, using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "components", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255, null: false
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2016-08-03 17:25:00 +02:00
|
|
|
create_table "coupons", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.string "code"
|
|
|
|
t.integer "percent_off"
|
|
|
|
t.datetime "valid_until"
|
|
|
|
t.integer "max_usages"
|
|
|
|
t.boolean "active"
|
2016-08-08 14:42:17 +02:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "validity_per_user"
|
2016-08-03 17:25:00 +02:00
|
|
|
end
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "credits", force: :cascade do |t|
|
|
|
|
t.integer "creditable_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "creditable_type", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "plan_id"
|
|
|
|
t.integer "hours"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "credits", ["plan_id"], name: "index_credits_on_plan_id", using: :btree
|
|
|
|
|
|
|
|
create_table "custom_assets", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "database_providers", force: :cascade do |t|
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2016-08-24 12:30:48 +02:00
|
|
|
create_table "event_price_categories", force: :cascade do |t|
|
|
|
|
t.integer "event_id"
|
|
|
|
t.integer "price_category_id"
|
|
|
|
t.integer "amount"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "event_price_categories", ["event_id"], name: "index_event_price_categories_on_event_id", using: :btree
|
|
|
|
add_index "event_price_categories", ["price_category_id"], name: "index_event_price_categories_on_price_category_id", using: :btree
|
|
|
|
|
2016-07-13 16:15:50 +02:00
|
|
|
create_table "event_themes", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "slug"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "event_themes", ["slug"], name: "index_event_themes_on_slug", unique: true, using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "events", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "title", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.text "description"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "availability_id"
|
|
|
|
t.integer "amount"
|
|
|
|
t.integer "nb_total_places"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "nb_free_places"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "recurrence_id"
|
2016-07-13 16:15:50 +02:00
|
|
|
t.integer "age_range_id"
|
2016-07-25 16:16:25 +02:00
|
|
|
t.integer "category_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "events", ["availability_id"], name: "index_events_on_availability_id", using: :btree
|
2016-07-25 16:16:25 +02:00
|
|
|
add_index "events", ["category_id"], name: "index_events_on_category_id", using: :btree
|
2015-05-05 03:10:25 +02:00
|
|
|
add_index "events", ["recurrence_id"], name: "index_events_on_recurrence_id", using: :btree
|
|
|
|
|
2016-07-13 16:15:50 +02:00
|
|
|
create_table "events_event_themes", force: :cascade do |t|
|
|
|
|
t.integer "event_id"
|
|
|
|
t.integer "event_theme_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "events_event_themes", ["event_id"], name: "index_events_event_themes_on_event_id", using: :btree
|
|
|
|
add_index "events_event_themes", ["event_theme_id"], name: "index_events_event_themes_on_event_theme_id", using: :btree
|
|
|
|
|
2016-07-27 11:28:54 +02:00
|
|
|
create_table "exports", force: :cascade do |t|
|
|
|
|
t.string "category"
|
|
|
|
t.string "export_type"
|
|
|
|
t.string "query"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.integer "user_id"
|
|
|
|
t.string "key"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "exports", ["user_id"], name: "index_exports_on_user_id", using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "friendly_id_slugs", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "slug", limit: 255, null: false
|
|
|
|
t.integer "sluggable_id", null: false
|
2015-05-05 03:10:25 +02:00
|
|
|
t.string "sluggable_type", limit: 50
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "scope", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "friendly_id_slugs", ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true, using: :btree
|
|
|
|
add_index "friendly_id_slugs", ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type", using: :btree
|
|
|
|
add_index "friendly_id_slugs", ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id", using: :btree
|
|
|
|
add_index "friendly_id_slugs", ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type", using: :btree
|
|
|
|
|
|
|
|
create_table "groups", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "slug", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
add_index "groups", ["slug"], name: "index_groups_on_slug", unique: true, using: :btree
|
|
|
|
|
|
|
|
create_table "invoice_items", force: :cascade do |t|
|
|
|
|
t.integer "invoice_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "stp_invoice_item_id", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "amount"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.text "description"
|
|
|
|
t.integer "subscription_id"
|
|
|
|
t.integer "invoice_item_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "invoice_items", ["invoice_id"], name: "index_invoice_items_on_invoice_id", using: :btree
|
|
|
|
|
|
|
|
create_table "invoices", force: :cascade do |t|
|
|
|
|
t.integer "invoiced_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "invoiced_type", limit: 255
|
|
|
|
t.string "stp_invoice_id", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "total"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "user_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "reference", limit: 255
|
|
|
|
t.string "avoir_mode", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "avoir_date"
|
|
|
|
t.integer "invoice_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "type", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.boolean "subscription_to_expire"
|
|
|
|
t.text "description"
|
2016-07-18 19:29:21 +02:00
|
|
|
t.integer "wallet_amount"
|
2016-07-20 15:07:43 +02:00
|
|
|
t.integer "wallet_transaction_id"
|
2016-08-03 17:25:00 +02:00
|
|
|
t.integer "coupon_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2016-08-03 17:25:00 +02:00
|
|
|
add_index "invoices", ["coupon_id"], name: "index_invoices_on_coupon_id", using: :btree
|
2016-03-23 18:39:41 +01:00
|
|
|
add_index "invoices", ["invoice_id"], name: "index_invoices_on_invoice_id", using: :btree
|
|
|
|
add_index "invoices", ["user_id"], name: "index_invoices_on_user_id", using: :btree
|
2016-07-20 15:07:43 +02:00
|
|
|
add_index "invoices", ["wallet_transaction_id"], name: "index_invoices_on_wallet_transaction_id", using: :btree
|
2016-03-23 18:39:41 +01:00
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "licences", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255, null: false
|
2015-05-05 03:10:25 +02:00
|
|
|
t.text "description"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "machines", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255, null: false
|
2015-05-05 03:10:25 +02:00
|
|
|
t.text "description"
|
|
|
|
t.text "spec"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "slug", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "machines", ["slug"], name: "index_machines_on_slug", unique: true, using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "machines_availabilities", force: :cascade do |t|
|
|
|
|
t.integer "machine_id"
|
|
|
|
t.integer "availability_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "machines_availabilities", ["availability_id"], name: "index_machines_availabilities_on_availability_id", using: :btree
|
|
|
|
add_index "machines_availabilities", ["machine_id"], name: "index_machines_availabilities_on_machine_id", using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "notifications", force: :cascade do |t|
|
|
|
|
t.integer "receiver_id"
|
|
|
|
t.integer "attached_object_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "attached_object_type", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "notification_type_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.boolean "is_read", default: false
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-06-28 10:02:36 +02:00
|
|
|
t.string "receiver_type"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.boolean "is_send", default: false
|
|
|
|
t.jsonb "meta_data", default: {}
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "notifications", ["notification_type_id"], name: "index_notifications_on_notification_type_id", using: :btree
|
|
|
|
add_index "notifications", ["receiver_id"], name: "index_notifications_on_receiver_id", using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "o_auth2_mappings", force: :cascade do |t|
|
|
|
|
t.integer "o_auth2_provider_id"
|
|
|
|
t.string "local_field"
|
|
|
|
t.string "api_field"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "local_model"
|
|
|
|
t.string "api_endpoint"
|
|
|
|
t.string "api_data_type"
|
2016-09-15 15:58:21 +02:00
|
|
|
t.jsonb "transformation"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "o_auth2_mappings", ["o_auth2_provider_id"], name: "index_o_auth2_mappings_on_o_auth2_provider_id", using: :btree
|
|
|
|
|
|
|
|
create_table "o_auth2_providers", force: :cascade do |t|
|
|
|
|
t.string "base_url"
|
|
|
|
t.string "token_endpoint"
|
|
|
|
t.string "authorization_endpoint"
|
|
|
|
t.string "client_id"
|
|
|
|
t.string "client_secret"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "profile_url"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "offer_days", force: :cascade do |t|
|
|
|
|
t.integer "subscription_id"
|
|
|
|
t.datetime "start_at"
|
|
|
|
t.datetime "end_at"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "offer_days", ["subscription_id"], name: "index_offer_days_on_subscription_id", using: :btree
|
|
|
|
|
2016-05-17 10:47:59 +02:00
|
|
|
create_table "open_api_calls_count_tracings", force: :cascade do |t|
|
|
|
|
t.integer "open_api_client_id"
|
|
|
|
t.integer "calls_count", null: false
|
|
|
|
t.datetime "at", null: false
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "open_api_calls_count_tracings", ["open_api_client_id"], name: "index_open_api_calls_count_tracings_on_open_api_client_id", using: :btree
|
|
|
|
|
|
|
|
create_table "open_api_clients", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.integer "calls_count", default: 0
|
|
|
|
t.string "token"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
2016-08-01 17:36:38 +02:00
|
|
|
create_table "organizations", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2016-08-02 12:27:45 +02:00
|
|
|
t.integer "profile_id"
|
2016-08-01 17:36:38 +02:00
|
|
|
end
|
|
|
|
|
2016-08-02 12:27:45 +02:00
|
|
|
add_index "organizations", ["profile_id"], name: "index_organizations_on_profile_id", using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "plans", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "amount"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "interval", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "group_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "stp_plan_id", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.integer "training_credit_nb", default: 0
|
|
|
|
t.boolean "is_rolling", default: true
|
2016-03-23 18:39:41 +01:00
|
|
|
t.text "description"
|
|
|
|
t.string "type"
|
|
|
|
t.string "base_name"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.integer "ui_weight", default: 0
|
|
|
|
t.integer "interval_count", default: 1
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "plans", ["group_id"], name: "index_plans_on_group_id", using: :btree
|
|
|
|
|
2016-08-24 12:30:48 +02:00
|
|
|
create_table "price_categories", force: :cascade do |t|
|
|
|
|
t.string "name"
|
2016-08-24 16:21:43 +02:00
|
|
|
t.text "conditions"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2016-08-24 12:30:48 +02:00
|
|
|
end
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "prices", force: :cascade do |t|
|
|
|
|
t.integer "group_id"
|
|
|
|
t.integer "plan_id"
|
|
|
|
t.integer "priceable_id"
|
|
|
|
t.string "priceable_type"
|
|
|
|
t.integer "amount"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "prices", ["group_id"], name: "index_prices_on_group_id", using: :btree
|
|
|
|
add_index "prices", ["plan_id"], name: "index_prices_on_plan_id", using: :btree
|
|
|
|
add_index "prices", ["priceable_type", "priceable_id"], name: "index_prices_on_priceable_type_and_priceable_id", using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "profiles", force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "first_name", limit: 255
|
|
|
|
t.string "last_name", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.boolean "gender"
|
|
|
|
t.date "birthday"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "phone", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.text "interest"
|
|
|
|
t.text "software_mastered"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "facebook"
|
|
|
|
t.string "twitter"
|
|
|
|
t.string "google_plus"
|
|
|
|
t.string "viadeo"
|
|
|
|
t.string "linkedin"
|
|
|
|
t.string "instagram"
|
|
|
|
t.string "youtube"
|
|
|
|
t.string "vimeo"
|
|
|
|
t.string "dailymotion"
|
|
|
|
t.string "github"
|
|
|
|
t.string "echosciences"
|
2016-05-16 14:46:57 +02:00
|
|
|
t.string "website"
|
2016-05-26 12:05:28 +02:00
|
|
|
t.string "pinterest"
|
|
|
|
t.string "lastfm"
|
|
|
|
t.string "flickr"
|
2016-05-26 12:34:30 +02:00
|
|
|
t.string "job"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "profiles", ["user_id"], name: "index_profiles_on_user_id", using: :btree
|
|
|
|
|
|
|
|
create_table "project_steps", force: :cascade do |t|
|
|
|
|
t.text "description"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "title", limit: 255
|
2016-06-02 12:49:00 +02:00
|
|
|
t.integer "step_nb"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "project_steps", ["project_id"], name: "index_project_steps_on_project_id", using: :btree
|
|
|
|
|
|
|
|
create_table "project_users", force: :cascade do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.boolean "is_valid", default: false
|
|
|
|
t.string "valid_token", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "project_users", ["project_id"], name: "index_project_users_on_project_id", using: :btree
|
|
|
|
add_index "project_users", ["user_id"], name: "index_project_users_on_user_id", using: :btree
|
|
|
|
|
|
|
|
create_table "projects", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.text "description"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "author_id"
|
|
|
|
t.text "tags"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "licence_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "state", limit: 255
|
|
|
|
t.string "slug", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "published_at"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2016-05-17 10:47:59 +02:00
|
|
|
add_index "projects", ["slug"], name: "index_projects_on_slug", using: :btree
|
2015-05-05 03:10:25 +02:00
|
|
|
|
|
|
|
create_table "projects_components", force: :cascade do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "component_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "projects_components", ["component_id"], name: "index_projects_components_on_component_id", using: :btree
|
|
|
|
add_index "projects_components", ["project_id"], name: "index_projects_components_on_project_id", using: :btree
|
|
|
|
|
|
|
|
create_table "projects_machines", force: :cascade do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "machine_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "projects_machines", ["machine_id"], name: "index_projects_machines_on_machine_id", using: :btree
|
|
|
|
add_index "projects_machines", ["project_id"], name: "index_projects_machines_on_project_id", using: :btree
|
|
|
|
|
|
|
|
create_table "projects_themes", force: :cascade do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "theme_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "projects_themes", ["project_id"], name: "index_projects_themes_on_project_id", using: :btree
|
|
|
|
add_index "projects_themes", ["theme_id"], name: "index_projects_themes_on_theme_id", using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "reservations", force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.text "message"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "reservable_id"
|
2016-08-31 11:58:37 +02:00
|
|
|
t.string "reservable_type", limit: 255
|
|
|
|
t.string "stp_invoice_id", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "nb_reserve_places"
|
|
|
|
end
|
|
|
|
|
2016-05-16 11:18:30 +02:00
|
|
|
add_index "reservations", ["reservable_id", "reservable_type"], name: "index_reservations_on_reservable_id_and_reservable_type", using: :btree
|
2016-03-23 18:39:41 +01:00
|
|
|
add_index "reservations", ["stp_invoice_id"], name: "index_reservations_on_stp_invoice_id", using: :btree
|
|
|
|
add_index "reservations", ["user_id"], name: "index_reservations_on_user_id", using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "roles", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "resource_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "resource_type", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "roles", ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id", using: :btree
|
|
|
|
add_index "roles", ["name"], name: "index_roles_on_name", using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "settings", force: :cascade do |t|
|
|
|
|
t.string "name", null: false
|
|
|
|
t.text "value"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "settings", ["name"], name: "index_settings_on_name", unique: true, using: :btree
|
|
|
|
|
|
|
|
create_table "slots", force: :cascade do |t|
|
|
|
|
t.datetime "start_at"
|
|
|
|
t.datetime "end_at"
|
|
|
|
t.integer "reservation_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "availability_id"
|
|
|
|
t.datetime "ex_start_at"
|
2016-06-16 11:10:56 +02:00
|
|
|
t.datetime "ex_end_at"
|
2016-06-28 10:02:36 +02:00
|
|
|
t.datetime "canceled_at"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.boolean "offered", default: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "slots", ["availability_id"], name: "index_slots_on_availability_id", using: :btree
|
|
|
|
add_index "slots", ["reservation_id"], name: "index_slots_on_reservation_id", using: :btree
|
|
|
|
|
2016-09-05 17:16:23 +02:00
|
|
|
create_table "statistic_custom_aggregations", force: :cascade do |t|
|
|
|
|
t.text "query"
|
|
|
|
t.integer "statistic_type_id"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "field"
|
2016-09-06 14:21:52 +02:00
|
|
|
t.string "es_index"
|
|
|
|
t.string "es_type"
|
2016-09-05 17:16:23 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "statistic_custom_aggregations", ["statistic_type_id"], name: "index_statistic_custom_aggregations_on_statistic_type_id", using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "statistic_fields", force: :cascade do |t|
|
|
|
|
t.integer "statistic_index_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "key", limit: 255
|
|
|
|
t.string "label", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "data_type", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "statistic_fields", ["statistic_index_id"], name: "index_statistic_fields_on_statistic_index_id", using: :btree
|
|
|
|
|
|
|
|
create_table "statistic_graphs", force: :cascade do |t|
|
|
|
|
t.integer "statistic_index_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "chart_type", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "limit"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "statistic_graphs", ["statistic_index_id"], name: "index_statistic_graphs_on_statistic_index_id", using: :btree
|
|
|
|
|
|
|
|
create_table "statistic_indices", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "es_type_key", limit: 255
|
|
|
|
t.string "label", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.boolean "table", default: true
|
|
|
|
t.boolean "ca", default: true
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "statistic_sub_types", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "key", limit: 255
|
|
|
|
t.string "label", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "statistic_type_sub_types", force: :cascade do |t|
|
|
|
|
t.integer "statistic_type_id"
|
|
|
|
t.integer "statistic_sub_type_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "statistic_type_sub_types", ["statistic_sub_type_id"], name: "index_statistic_type_sub_types_on_statistic_sub_type_id", using: :btree
|
|
|
|
add_index "statistic_type_sub_types", ["statistic_type_id"], name: "index_statistic_type_sub_types_on_statistic_type_id", using: :btree
|
|
|
|
|
|
|
|
create_table "statistic_types", force: :cascade do |t|
|
|
|
|
t.integer "statistic_index_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "key", limit: 255
|
|
|
|
t.string "label", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.boolean "graph"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.boolean "simple"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "statistic_types", ["statistic_index_id"], name: "index_statistic_types_on_statistic_index_id", using: :btree
|
|
|
|
|
|
|
|
create_table "stylesheets", force: :cascade do |t|
|
|
|
|
t.text "contents"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "subscriptions", force: :cascade do |t|
|
|
|
|
t.integer "plan_id"
|
|
|
|
t.integer "user_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "stp_subscription_id", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.datetime "expired_at"
|
|
|
|
t.datetime "canceled_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "subscriptions", ["plan_id"], name: "index_subscriptions_on_plan_id", using: :btree
|
|
|
|
add_index "subscriptions", ["user_id"], name: "index_subscriptions_on_user_id", using: :btree
|
|
|
|
|
|
|
|
create_table "tags", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "themes", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255, null: false
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2016-08-25 18:41:33 +02:00
|
|
|
create_table "tickets", force: :cascade do |t|
|
|
|
|
t.integer "reservation_id"
|
|
|
|
t.integer "event_price_category_id"
|
|
|
|
t.integer "booked"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "tickets", ["event_price_category_id"], name: "index_tickets_on_event_price_category_id", using: :btree
|
|
|
|
add_index "tickets", ["reservation_id"], name: "index_tickets_on_reservation_id", using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "trainings", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "name", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "nb_total_places"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "slug", limit: 255
|
2016-03-23 18:39:41 +01:00
|
|
|
t.text "description"
|
2016-07-14 12:18:24 +02:00
|
|
|
t.boolean "public_page", default: true
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
add_index "trainings", ["slug"], name: "index_trainings_on_slug", unique: true, using: :btree
|
|
|
|
|
|
|
|
create_table "trainings_availabilities", force: :cascade do |t|
|
|
|
|
t.integer "training_id"
|
|
|
|
t.integer "availability_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "trainings_availabilities", ["availability_id"], name: "index_trainings_availabilities_on_availability_id", using: :btree
|
|
|
|
add_index "trainings_availabilities", ["training_id"], name: "index_trainings_availabilities_on_training_id", using: :btree
|
|
|
|
|
|
|
|
create_table "trainings_machines", force: :cascade do |t|
|
|
|
|
t.integer "training_id"
|
|
|
|
t.integer "machine_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "trainings_machines", ["machine_id"], name: "index_trainings_machines_on_machine_id", using: :btree
|
|
|
|
add_index "trainings_machines", ["training_id"], name: "index_trainings_machines_on_training_id", using: :btree
|
|
|
|
|
|
|
|
create_table "trainings_pricings", force: :cascade do |t|
|
|
|
|
t.integer "group_id"
|
|
|
|
t.integer "amount"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "training_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "trainings_pricings", ["group_id"], name: "index_trainings_pricings_on_group_id", using: :btree
|
|
|
|
add_index "trainings_pricings", ["training_id"], name: "index_trainings_pricings_on_training_id", using: :btree
|
|
|
|
|
|
|
|
create_table "user_tags", force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "tag_id"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "user_tags", ["tag_id"], name: "index_user_tags_on_tag_id", using: :btree
|
|
|
|
add_index "user_tags", ["user_id"], name: "index_user_tags_on_user_id", using: :btree
|
|
|
|
|
|
|
|
create_table "user_trainings", force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "training_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "user_trainings", ["training_id"], name: "index_user_trainings_on_training_id", using: :btree
|
|
|
|
add_index "user_trainings", ["user_id"], name: "index_user_trainings_on_user_id", using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "users", force: :cascade do |t|
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "email", limit: 255, default: "", null: false
|
|
|
|
t.string "encrypted_password", limit: 255, default: "", null: false
|
|
|
|
t.string "reset_password_token", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "reset_password_sent_at"
|
|
|
|
t.datetime "remember_created_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.integer "sign_in_count", default: 0, null: false
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "current_sign_in_at"
|
|
|
|
t.datetime "last_sign_in_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "current_sign_in_ip", limit: 255
|
|
|
|
t.string "last_sign_in_ip", limit: 255
|
|
|
|
t.string "confirmation_token", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "confirmed_at"
|
|
|
|
t.datetime "confirmation_sent_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "unconfirmed_email", limit: 255
|
|
|
|
t.integer "failed_attempts", default: 0, null: false
|
|
|
|
t.string "unlock_token", limit: 255
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "locked_at"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.boolean "is_allow_contact", default: true
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "group_id"
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "stp_customer_id", limit: 255
|
2016-06-28 10:02:36 +02:00
|
|
|
t.string "username", limit: 255
|
2016-05-16 11:18:30 +02:00
|
|
|
t.string "slug", limit: 255
|
|
|
|
t.boolean "is_active", default: true
|
|
|
|
t.boolean "invoicing_disabled", default: false
|
2016-03-23 18:39:41 +01:00
|
|
|
t.string "provider"
|
|
|
|
t.string "uid"
|
|
|
|
t.string "auth_token"
|
|
|
|
t.datetime "merged_at"
|
2016-07-28 12:20:51 +02:00
|
|
|
t.boolean "is_allow_newsletter"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
add_index "users", ["auth_token"], name: "index_users_on_auth_token", using: :btree
|
2015-05-05 03:10:25 +02:00
|
|
|
add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree
|
|
|
|
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
|
|
|
|
add_index "users", ["group_id"], name: "index_users_on_group_id", using: :btree
|
2016-03-23 18:39:41 +01:00
|
|
|
add_index "users", ["provider"], name: "index_users_on_provider", using: :btree
|
2015-05-05 03:10:25 +02:00
|
|
|
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree
|
|
|
|
add_index "users", ["slug"], name: "index_users_on_slug", unique: true, using: :btree
|
2016-03-23 18:39:41 +01:00
|
|
|
add_index "users", ["uid"], name: "index_users_on_uid", using: :btree
|
2015-05-05 03:10:25 +02:00
|
|
|
add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true, using: :btree
|
|
|
|
add_index "users", ["username"], name: "index_users_on_username", unique: true, using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
create_table "users_credits", force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "credit_id"
|
|
|
|
t.integer "hours_used"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "users_credits", ["credit_id"], name: "index_users_credits_on_credit_id", using: :btree
|
|
|
|
add_index "users_credits", ["user_id"], name: "index_users_credits_on_user_id", using: :btree
|
|
|
|
|
2015-05-05 03:10:25 +02:00
|
|
|
create_table "users_roles", id: false, force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "role_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "users_roles", ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id", using: :btree
|
|
|
|
|
2016-07-04 19:20:10 +02:00
|
|
|
create_table "wallet_transactions", force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "wallet_id"
|
|
|
|
t.integer "transactable_id"
|
|
|
|
t.string "transactable_type"
|
|
|
|
t.string "transaction_type"
|
|
|
|
t.integer "amount"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "wallet_transactions", ["transactable_type", "transactable_id"], name: "index_wallet_transactions_on_transactable", using: :btree
|
|
|
|
add_index "wallet_transactions", ["user_id"], name: "index_wallet_transactions_on_user_id", using: :btree
|
|
|
|
add_index "wallet_transactions", ["wallet_id"], name: "index_wallet_transactions_on_wallet_id", using: :btree
|
|
|
|
|
2016-07-18 18:16:54 +02:00
|
|
|
create_table "wallets", force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "amount", default: 0
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "wallets", ["user_id"], name: "index_wallets_on_user_id", using: :btree
|
|
|
|
|
2016-03-23 18:39:41 +01:00
|
|
|
add_foreign_key "availability_tags", "availabilities"
|
|
|
|
add_foreign_key "availability_tags", "tags"
|
2016-08-24 12:30:48 +02:00
|
|
|
add_foreign_key "event_price_categories", "events"
|
|
|
|
add_foreign_key "event_price_categories", "price_categories"
|
2016-07-25 16:16:25 +02:00
|
|
|
add_foreign_key "events", "categories"
|
2016-07-13 16:15:50 +02:00
|
|
|
add_foreign_key "events_event_themes", "event_themes"
|
|
|
|
add_foreign_key "events_event_themes", "events"
|
2016-07-27 11:28:54 +02:00
|
|
|
add_foreign_key "exports", "users"
|
2016-08-03 17:25:00 +02:00
|
|
|
add_foreign_key "invoices", "coupons"
|
2016-07-20 15:07:43 +02:00
|
|
|
add_foreign_key "invoices", "wallet_transactions"
|
2016-03-23 18:39:41 +01:00
|
|
|
add_foreign_key "o_auth2_mappings", "o_auth2_providers"
|
2016-05-17 10:47:59 +02:00
|
|
|
add_foreign_key "open_api_calls_count_tracings", "open_api_clients"
|
2016-08-02 12:27:45 +02:00
|
|
|
add_foreign_key "organizations", "profiles"
|
2016-03-23 18:39:41 +01:00
|
|
|
add_foreign_key "prices", "groups"
|
|
|
|
add_foreign_key "prices", "plans"
|
2016-09-05 17:16:23 +02:00
|
|
|
add_foreign_key "statistic_custom_aggregations", "statistic_types"
|
2016-08-25 18:41:33 +02:00
|
|
|
add_foreign_key "tickets", "event_price_categories"
|
|
|
|
add_foreign_key "tickets", "reservations"
|
2016-03-23 18:39:41 +01:00
|
|
|
add_foreign_key "user_tags", "tags"
|
|
|
|
add_foreign_key "user_tags", "users"
|
2016-07-04 19:20:10 +02:00
|
|
|
add_foreign_key "wallet_transactions", "users"
|
|
|
|
add_foreign_key "wallet_transactions", "wallets"
|
2016-07-18 18:16:54 +02:00
|
|
|
add_foreign_key "wallets", "users"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|