2015-05-05 03:10:25 +02:00
|
|
|
# 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.
|
|
|
|
|
2021-12-20 15:47:57 +01:00
|
|
|
ActiveRecord::Schema.define(version: 2021_12_20_143400) do
|
2015-05-05 03:10:25 +02:00
|
|
|
|
|
|
|
# These are extensions that must be enabled in order to support this database
|
2020-06-22 16:28:05 +02:00
|
|
|
enable_extension "fuzzystrmatch"
|
2020-04-08 12:58:59 +02:00
|
|
|
enable_extension "pg_trgm"
|
2015-05-05 03:10:25 +02:00
|
|
|
enable_extension "plpgsql"
|
2020-01-13 17:05:53 +01:00
|
|
|
enable_extension "unaccent"
|
2015-05-05 03:10:25 +02:00
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "abuses", id: :serial, force: :cascade do |t|
|
2021-10-14 18:20:10 +02:00
|
|
|
t.integer "signaled_id"
|
2021-10-18 15:19:58 +02:00
|
|
|
t.string "signaled_type"
|
2020-03-24 16:45:27 +01:00
|
|
|
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
|
|
|
|
t.index ["signaled_type", "signaled_id"], name: "index_abuses_on_signaled_type_and_signaled_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "accounting_periods", id: :serial, force: :cascade do |t|
|
|
|
|
t.date "start_at"
|
|
|
|
t.date "end_at"
|
2019-02-12 14:45:21 +01:00
|
|
|
t.datetime "closed_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "closed_by"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.integer "period_total"
|
|
|
|
t.integer "perpetual_total"
|
|
|
|
t.string "footprint"
|
2019-02-12 14:45:21 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "addresses", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "address"
|
|
|
|
t.string "street_number"
|
|
|
|
t.string "route"
|
|
|
|
t.string "locality"
|
|
|
|
t.string "country"
|
|
|
|
t.string "postal_code"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.integer "placeable_id"
|
2021-10-18 15:19:58 +02:00
|
|
|
t.string "placeable_type"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "age_ranges", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
2016-07-13 16:15:50 +02:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "slug"
|
|
|
|
t.index ["slug"], name: "index_age_ranges_on_slug", unique: true
|
2016-07-13 16:15:50 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "assets", id: :serial, force: :cascade do |t|
|
2021-10-14 18:20:10 +02:00
|
|
|
t.integer "viewable_id"
|
2021-10-18 15:19:58 +02:00
|
|
|
t.string "viewable_type"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "attachment"
|
|
|
|
t.string "type"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "auth_providers", id: :serial, 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"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "availabilities", id: :serial, force: :cascade do |t|
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "start_at"
|
|
|
|
t.datetime "end_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "available_type"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "nb_total_places"
|
|
|
|
t.boolean "destroying", default: false
|
|
|
|
t.boolean "lock", default: false
|
|
|
|
t.boolean "is_recurrent"
|
|
|
|
t.integer "occurrence_id"
|
|
|
|
t.string "period"
|
|
|
|
t.integer "nb_periods"
|
2019-11-13 12:13:22 +01:00
|
|
|
t.datetime "end_date"
|
2020-04-15 18:08:02 +02:00
|
|
|
t.integer "slot_duration"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "availability_tags", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "availability_id"
|
|
|
|
t.integer "tag_id"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["availability_id"], name: "index_availability_tags_on_availability_id"
|
|
|
|
t.index ["tag_id"], name: "index_availability_tags_on_tag_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "categories", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "slug"
|
|
|
|
t.index ["slug"], name: "index_categories_on_slug", unique: true
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "components", id: :serial, force: :cascade do |t|
|
2019-09-17 14:48:06 +02:00
|
|
|
t.string "name", null: false
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "coupons", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.string "code"
|
|
|
|
t.integer "percent_off"
|
2016-08-03 17:25:00 +02:00
|
|
|
t.datetime "valid_until"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "max_usages"
|
|
|
|
t.boolean "active"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "validity_per_user"
|
|
|
|
t.integer "amount_off"
|
2016-08-03 17:25:00 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "credits", id: :serial, force: :cascade do |t|
|
2021-10-14 18:20:10 +02:00
|
|
|
t.integer "creditable_id"
|
2021-10-18 15:19:58 +02:00
|
|
|
t.string "creditable_type"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "plan_id"
|
|
|
|
t.integer "hours"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["plan_id"], name: "index_credits_on_plan_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "custom_assets", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "database_providers", id: :serial, force: :cascade do |t|
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "event_price_categories", id: :serial, 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
|
|
|
|
t.index ["event_id"], name: "index_event_price_categories_on_event_id"
|
|
|
|
t.index ["price_category_id"], name: "index_event_price_categories_on_price_category_id"
|
2016-08-24 12:30:48 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "event_themes", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
2016-07-13 16:15:50 +02:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "slug"
|
|
|
|
t.index ["slug"], name: "index_event_themes_on_slug", unique: true
|
2016-07-13 16:15:50 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "events", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "title"
|
|
|
|
t.text "description"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "availability_id"
|
|
|
|
t.integer "amount"
|
|
|
|
t.integer "nb_total_places"
|
|
|
|
t.integer "nb_free_places"
|
|
|
|
t.integer "recurrence_id"
|
|
|
|
t.integer "age_range_id"
|
|
|
|
t.integer "category_id"
|
|
|
|
t.index ["availability_id"], name: "index_events_on_availability_id"
|
|
|
|
t.index ["category_id"], name: "index_events_on_category_id"
|
|
|
|
t.index ["recurrence_id"], name: "index_events_on_recurrence_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "events_event_themes", id: :serial, force: :cascade do |t|
|
2016-07-13 16:15:50 +02:00
|
|
|
t.integer "event_id"
|
|
|
|
t.integer "event_theme_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["event_id"], name: "index_events_event_themes_on_event_id"
|
|
|
|
t.index ["event_theme_id"], name: "index_events_event_themes_on_event_theme_id"
|
2016-07-13 16:15:50 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "exports", id: :serial, 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"
|
|
|
|
t.string "extension", default: "xlsx"
|
|
|
|
t.index ["user_id"], name: "index_exports_on_user_id"
|
2016-07-27 11:28:54 +02:00
|
|
|
end
|
|
|
|
|
2021-10-14 18:20:10 +02:00
|
|
|
create_table "footprint_debugs", force: :cascade do |t|
|
|
|
|
t.string "footprint"
|
|
|
|
t.string "data"
|
|
|
|
t.string "klass"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "friendly_id_slugs", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "slug", null: false
|
|
|
|
t.integer "sluggable_id", null: false
|
|
|
|
t.string "sluggable_type", limit: 50
|
|
|
|
t.string "scope"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["slug", "sluggable_type", "scope"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope", unique: true
|
|
|
|
t.index ["slug", "sluggable_type"], name: "index_friendly_id_slugs_on_slug_and_sluggable_type"
|
|
|
|
t.index ["sluggable_id"], name: "index_friendly_id_slugs_on_sluggable_id"
|
|
|
|
t.index ["sluggable_type"], name: "index_friendly_id_slugs_on_sluggable_type"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "groups", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "slug"
|
|
|
|
t.boolean "disabled"
|
|
|
|
t.index ["slug"], name: "index_groups_on_slug", unique: true
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "history_values", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "setting_id"
|
|
|
|
t.string "value"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.string "footprint"
|
|
|
|
t.integer "invoicing_profile_id"
|
|
|
|
t.index ["invoicing_profile_id"], name: "index_history_values_on_invoicing_profile_id"
|
|
|
|
t.index ["setting_id"], name: "index_history_values_on_setting_id"
|
2018-12-17 16:02:02 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "i_calendar_events", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "uid"
|
2019-12-02 15:53:24 +01:00
|
|
|
t.datetime "dtstart"
|
|
|
|
t.datetime "dtend"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "summary"
|
|
|
|
t.string "description"
|
|
|
|
t.string "attendee"
|
|
|
|
t.integer "i_calendar_id"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["i_calendar_id"], name: "index_i_calendar_events_on_i_calendar_id"
|
2019-12-02 15:53:24 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "i_calendars", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "url"
|
|
|
|
t.string "name"
|
|
|
|
t.string "color"
|
|
|
|
t.string "text_color"
|
|
|
|
t.boolean "text_hidden"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2019-11-27 17:05:19 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "imports", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.string "attachment"
|
|
|
|
t.string "update_field"
|
|
|
|
t.string "category"
|
|
|
|
t.text "results"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2019-09-24 17:42:50 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "invoice_items", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "invoice_id"
|
|
|
|
t.integer "amount"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.text "description"
|
|
|
|
t.integer "invoice_item_id"
|
|
|
|
t.string "footprint"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.string "object_type"
|
|
|
|
t.bigint "object_id"
|
|
|
|
t.boolean "main"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["invoice_id"], name: "index_invoice_items_on_invoice_id"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.index ["object_type", "object_id"], name: "index_invoice_items_on_object_type_and_object_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "invoices", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "total"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "reference"
|
|
|
|
t.string "payment_method"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "avoir_date"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "invoice_id"
|
|
|
|
t.string "type"
|
|
|
|
t.boolean "subscription_to_expire"
|
|
|
|
t.text "description"
|
|
|
|
t.integer "wallet_amount"
|
|
|
|
t.integer "wallet_transaction_id"
|
|
|
|
t.integer "coupon_id"
|
|
|
|
t.string "footprint"
|
|
|
|
t.string "environment"
|
|
|
|
t.integer "invoicing_profile_id"
|
|
|
|
t.integer "operator_profile_id"
|
|
|
|
t.integer "statistic_profile_id"
|
|
|
|
t.index ["coupon_id"], name: "index_invoices_on_coupon_id"
|
|
|
|
t.index ["invoice_id"], name: "index_invoices_on_invoice_id"
|
|
|
|
t.index ["invoicing_profile_id"], name: "index_invoices_on_invoicing_profile_id"
|
|
|
|
t.index ["statistic_profile_id"], name: "index_invoices_on_statistic_profile_id"
|
|
|
|
t.index ["wallet_transaction_id"], name: "index_invoices_on_wallet_transaction_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "invoicing_profiles", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.string "first_name"
|
|
|
|
t.string "last_name"
|
|
|
|
t.string "email"
|
2019-05-28 16:02:55 +02:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["user_id"], name: "index_invoicing_profiles_on_user_id"
|
2019-05-28 16:02:55 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "licences", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name", null: false
|
|
|
|
t.text "description"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "machines", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name", null: false
|
|
|
|
t.text "description"
|
|
|
|
t.text "spec"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "slug"
|
|
|
|
t.boolean "disabled"
|
|
|
|
t.index ["slug"], name: "index_machines_on_slug", unique: true
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "machines_availabilities", id: :serial, force: :cascade do |t|
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "machine_id"
|
|
|
|
t.integer "availability_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["availability_id"], name: "index_machines_availabilities_on_availability_id"
|
|
|
|
t.index ["machine_id"], name: "index_machines_availabilities_on_machine_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "notifications", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "receiver_id"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.integer "attached_object_id"
|
2021-10-18 15:19:58 +02:00
|
|
|
t.string "attached_object_type"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "notification_type_id"
|
|
|
|
t.boolean "is_read", default: false
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "receiver_type"
|
|
|
|
t.boolean "is_send", default: false
|
2021-10-18 15:19:58 +02:00
|
|
|
t.jsonb "meta_data", default: {}
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["notification_type_id"], name: "index_notifications_on_notification_type_id"
|
|
|
|
t.index ["receiver_id"], name: "index_notifications_on_receiver_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "o_auth2_mappings", id: :serial, 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"
|
|
|
|
t.jsonb "transformation"
|
|
|
|
t.index ["o_auth2_provider_id"], name: "index_o_auth2_mappings_on_o_auth2_provider_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "o_auth2_providers", id: :serial, 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"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "offer_days", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "subscription_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "start_at"
|
|
|
|
t.datetime "end_at"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["subscription_id"], name: "index_offer_days_on_subscription_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "open_api_calls_count_tracings", id: :serial, 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
|
|
|
|
t.index ["open_api_client_id"], name: "index_open_api_calls_count_tracings_on_open_api_client_id"
|
2016-05-17 10:47:59 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "open_api_clients", id: :serial, 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
|
2016-05-17 10:47:59 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "organizations", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.integer "invoicing_profile_id"
|
|
|
|
t.index ["invoicing_profile_id"], name: "index_organizations_on_invoicing_profile_id"
|
2016-08-01 17:36:38 +02:00
|
|
|
end
|
|
|
|
|
2021-10-14 18:20:10 +02:00
|
|
|
create_table "payment_gateway_objects", force: :cascade do |t|
|
|
|
|
t.string "gateway_object_id"
|
|
|
|
t.string "gateway_object_type"
|
|
|
|
t.string "item_type"
|
|
|
|
t.bigint "item_id"
|
|
|
|
t.bigint "payment_gateway_object_id"
|
|
|
|
t.index ["item_type", "item_id"], name: "index_payment_gateway_objects_on_item_type_and_item_id"
|
|
|
|
t.index ["payment_gateway_object_id"], name: "index_payment_gateway_objects_on_payment_gateway_object_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "payment_schedule_items", force: :cascade do |t|
|
|
|
|
t.integer "amount"
|
|
|
|
t.datetime "due_date"
|
|
|
|
t.string "state", default: "new"
|
|
|
|
t.jsonb "details", default: "{}"
|
|
|
|
t.string "payment_method"
|
|
|
|
t.string "client_secret"
|
|
|
|
t.bigint "payment_schedule_id"
|
|
|
|
t.bigint "invoice_id"
|
|
|
|
t.string "footprint"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["invoice_id"], name: "index_payment_schedule_items_on_invoice_id"
|
|
|
|
t.index ["payment_schedule_id"], name: "index_payment_schedule_items_on_payment_schedule_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "payment_schedule_objects", force: :cascade do |t|
|
|
|
|
t.string "object_type"
|
|
|
|
t.bigint "object_id"
|
|
|
|
t.bigint "payment_schedule_id"
|
|
|
|
t.boolean "main"
|
|
|
|
t.string "footprint"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["object_type", "object_id"], name: "index_payment_schedule_objects_on_object_type_and_object_id"
|
|
|
|
t.index ["payment_schedule_id"], name: "index_payment_schedule_objects_on_payment_schedule_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "payment_schedules", force: :cascade do |t|
|
|
|
|
t.integer "total"
|
|
|
|
t.string "reference"
|
|
|
|
t.string "payment_method"
|
|
|
|
t.integer "wallet_amount"
|
|
|
|
t.bigint "wallet_transaction_id"
|
|
|
|
t.bigint "coupon_id"
|
|
|
|
t.string "footprint"
|
|
|
|
t.string "environment"
|
|
|
|
t.bigint "invoicing_profile_id"
|
|
|
|
t.bigint "statistic_profile_id"
|
|
|
|
t.bigint "operator_profile_id"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2021-10-18 15:19:58 +02:00
|
|
|
t.datetime "start_at"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.index ["coupon_id"], name: "index_payment_schedules_on_coupon_id"
|
|
|
|
t.index ["invoicing_profile_id"], name: "index_payment_schedules_on_invoicing_profile_id"
|
|
|
|
t.index ["operator_profile_id"], name: "index_payment_schedules_on_operator_profile_id"
|
|
|
|
t.index ["statistic_profile_id"], name: "index_payment_schedules_on_statistic_profile_id"
|
|
|
|
t.index ["wallet_transaction_id"], name: "index_payment_schedules_on_wallet_transaction_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "plan_categories", force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.integer "weight"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2021-12-20 15:47:57 +01:00
|
|
|
t.text "description"
|
2021-10-14 18:20:10 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "plans", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.integer "amount"
|
|
|
|
t.string "interval"
|
|
|
|
t.integer "group_id"
|
|
|
|
t.string "stp_plan_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "training_credit_nb", default: 0
|
|
|
|
t.boolean "is_rolling", default: true
|
|
|
|
t.text "description"
|
|
|
|
t.string "type"
|
|
|
|
t.string "base_name"
|
|
|
|
t.integer "ui_weight", default: 0
|
|
|
|
t.integer "interval_count", default: 1
|
|
|
|
t.string "slug"
|
|
|
|
t.boolean "disabled"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.boolean "monthly_payment"
|
|
|
|
t.bigint "plan_category_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["group_id"], name: "index_plans_on_group_id"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.index ["plan_category_id"], name: "index_plans_on_plan_category_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "plans_availabilities", id: :serial, force: :cascade do |t|
|
2020-02-07 17:37:00 +01:00
|
|
|
t.integer "plan_id"
|
|
|
|
t.integer "availability_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["availability_id"], name: "index_plans_availabilities_on_availability_id"
|
|
|
|
t.index ["plan_id"], name: "index_plans_availabilities_on_plan_id"
|
2020-02-07 17:37:00 +01:00
|
|
|
end
|
|
|
|
|
2021-10-14 18:20:10 +02:00
|
|
|
create_table "prepaid_packs", force: :cascade do |t|
|
|
|
|
t.string "priceable_type"
|
|
|
|
t.bigint "priceable_id"
|
|
|
|
t.bigint "group_id"
|
|
|
|
t.integer "amount"
|
|
|
|
t.integer "minutes"
|
|
|
|
t.string "validity_interval"
|
|
|
|
t.integer "validity_count"
|
|
|
|
t.boolean "disabled"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["group_id"], name: "index_prepaid_packs_on_group_id"
|
|
|
|
t.index ["priceable_type", "priceable_id"], name: "index_prepaid_packs_on_priceable_type_and_priceable_id"
|
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "price_categories", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.text "conditions"
|
2016-08-24 16:21:43 +02:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2016-08-24 12:30:48 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "prices", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "group_id"
|
|
|
|
t.integer "plan_id"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.integer "priceable_id"
|
2021-10-18 15:19:58 +02:00
|
|
|
t.string "priceable_type"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "amount"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2021-12-20 15:47:57 +01:00
|
|
|
t.integer "duration", default: 60
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["group_id"], name: "index_prices_on_group_id"
|
|
|
|
t.index ["plan_id"], name: "index_prices_on_plan_id"
|
|
|
|
t.index ["priceable_type", "priceable_id"], name: "index_prices_on_priceable_type_and_priceable_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "profiles", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.string "first_name"
|
|
|
|
t.string "last_name"
|
|
|
|
t.string "phone"
|
|
|
|
t.text "interest"
|
|
|
|
t.text "software_mastered"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
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"
|
|
|
|
t.string "website"
|
|
|
|
t.string "pinterest"
|
|
|
|
t.string "lastfm"
|
|
|
|
t.string "flickr"
|
|
|
|
t.string "job"
|
|
|
|
t.string "tours"
|
|
|
|
t.index "lower(f_unaccent((first_name)::text)) gin_trgm_ops", name: "profiles_lower_unaccent_first_name_trgm_idx", using: :gin
|
|
|
|
t.index "lower(f_unaccent((last_name)::text)) gin_trgm_ops", name: "profiles_lower_unaccent_last_name_trgm_idx", using: :gin
|
|
|
|
t.index ["user_id"], name: "index_profiles_on_user_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "project_steps", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "description"
|
|
|
|
t.integer "project_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "title"
|
|
|
|
t.integer "step_nb"
|
|
|
|
t.index ["project_id"], name: "index_project_steps_on_project_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "project_users", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "user_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.boolean "is_valid", default: false
|
|
|
|
t.string "valid_token"
|
|
|
|
t.index ["project_id"], name: "index_project_users_on_project_id"
|
|
|
|
t.index ["user_id"], name: "index_project_users_on_user_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "projects", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.text "description"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.text "tags"
|
|
|
|
t.integer "licence_id"
|
|
|
|
t.string "state"
|
|
|
|
t.string "slug"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "published_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "author_statistic_profile_id"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.tsvector "search_vector"
|
|
|
|
t.index ["search_vector"], name: "projects_search_vector_idx", using: :gin
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["slug"], name: "index_projects_on_slug", unique: true
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "projects_components", id: :serial, force: :cascade do |t|
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "component_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["component_id"], name: "index_projects_components_on_component_id"
|
|
|
|
t.index ["project_id"], name: "index_projects_components_on_project_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "projects_machines", id: :serial, force: :cascade do |t|
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "machine_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["machine_id"], name: "index_projects_machines_on_machine_id"
|
|
|
|
t.index ["project_id"], name: "index_projects_machines_on_project_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "projects_spaces", id: :serial, force: :cascade do |t|
|
2017-02-13 14:38:28 +01:00
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "space_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["project_id"], name: "index_projects_spaces_on_project_id"
|
|
|
|
t.index ["space_id"], name: "index_projects_spaces_on_space_id"
|
2017-02-13 14:38:28 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "projects_themes", id: :serial, force: :cascade do |t|
|
2015-05-05 03:10:25 +02:00
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "theme_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["project_id"], name: "index_projects_themes_on_project_id"
|
|
|
|
t.index ["theme_id"], name: "index_projects_themes_on_theme_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "reservations", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "message"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.integer "reservable_id"
|
2021-10-18 15:19:58 +02:00
|
|
|
t.string "reservable_type"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "nb_reserve_places"
|
|
|
|
t.integer "statistic_profile_id"
|
|
|
|
t.index ["reservable_type", "reservable_id"], name: "index_reservations_on_reservable_type_and_reservable_id"
|
|
|
|
t.index ["statistic_profile_id"], name: "index_reservations_on_statistic_profile_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "roles", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.integer "resource_id"
|
2021-10-18 15:19:58 +02:00
|
|
|
t.string "resource_type"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["name", "resource_type", "resource_id"], name: "index_roles_on_name_and_resource_type_and_resource_id"
|
|
|
|
t.index ["name"], name: "index_roles_on_name"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "settings", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name", null: false
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["name"], name: "index_settings_on_name", unique: true
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "slots", id: :serial, force: :cascade do |t|
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "start_at"
|
|
|
|
t.datetime "end_at"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "availability_id"
|
2017-02-28 16:51:56 +01:00
|
|
|
t.datetime "ex_start_at"
|
2017-03-01 11:47:20 +01:00
|
|
|
t.datetime "ex_end_at"
|
|
|
|
t.datetime "canceled_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.boolean "offered", default: false
|
|
|
|
t.boolean "destroying", default: false
|
|
|
|
t.index ["availability_id"], name: "index_slots_on_availability_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "slots_reservations", id: :serial, force: :cascade do |t|
|
2017-02-28 16:51:56 +01:00
|
|
|
t.integer "slot_id"
|
|
|
|
t.integer "reservation_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["reservation_id"], name: "index_slots_reservations_on_reservation_id"
|
|
|
|
t.index ["slot_id"], name: "index_slots_reservations_on_slot_id"
|
2017-02-28 16:51:56 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "spaces", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.integer "default_places"
|
|
|
|
t.text "description"
|
|
|
|
t.string "slug"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.text "characteristics"
|
|
|
|
t.boolean "disabled"
|
2017-02-13 14:38:28 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "spaces_availabilities", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "space_id"
|
|
|
|
t.integer "availability_id"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["availability_id"], name: "index_spaces_availabilities_on_availability_id"
|
|
|
|
t.index ["space_id"], name: "index_spaces_availabilities_on_space_id"
|
2017-02-28 16:51:56 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_custom_aggregations", id: :serial, 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"
|
|
|
|
t.string "es_index"
|
|
|
|
t.string "es_type"
|
|
|
|
t.index ["statistic_type_id"], name: "index_statistic_custom_aggregations_on_statistic_type_id"
|
2016-09-05 17:16:23 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_fields", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "statistic_index_id"
|
|
|
|
t.string "key"
|
|
|
|
t.string "label"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "data_type"
|
|
|
|
t.index ["statistic_index_id"], name: "index_statistic_fields_on_statistic_index_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_graphs", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "statistic_index_id"
|
|
|
|
t.string "chart_type"
|
|
|
|
t.integer "limit"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["statistic_index_id"], name: "index_statistic_graphs_on_statistic_index_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_indices", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "es_type_key"
|
|
|
|
t.string "label"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.boolean "table", default: true
|
|
|
|
t.boolean "ca", default: true
|
2019-06-04 13:33:00 +02:00
|
|
|
end
|
|
|
|
|
2021-10-14 18:20:10 +02:00
|
|
|
create_table "statistic_profile_prepaid_packs", force: :cascade do |t|
|
|
|
|
t.bigint "prepaid_pack_id"
|
|
|
|
t.bigint "statistic_profile_id"
|
|
|
|
t.integer "minutes_used", default: 0
|
|
|
|
t.datetime "expires_at"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["prepaid_pack_id"], name: "index_statistic_profile_prepaid_packs_on_prepaid_pack_id"
|
|
|
|
t.index ["statistic_profile_id"], name: "index_statistic_profile_prepaid_packs_on_statistic_profile_id"
|
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_profile_trainings", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "statistic_profile_id"
|
|
|
|
t.integer "training_id"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.index ["statistic_profile_id"], name: "index_statistic_profile_trainings_on_statistic_profile_id"
|
|
|
|
t.index ["training_id"], name: "index_statistic_profile_trainings_on_training_id"
|
2019-06-06 12:00:21 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_profiles", id: :serial, force: :cascade do |t|
|
|
|
|
t.boolean "gender"
|
|
|
|
t.date "birthday"
|
|
|
|
t.integer "group_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "role_id"
|
2019-06-06 16:54:09 +02:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["group_id"], name: "index_statistic_profiles_on_group_id"
|
|
|
|
t.index ["role_id"], name: "index_statistic_profiles_on_role_id"
|
|
|
|
t.index ["user_id"], name: "index_statistic_profiles_on_user_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_sub_types", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "key"
|
|
|
|
t.string "label"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_type_sub_types", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "statistic_type_id"
|
|
|
|
t.integer "statistic_sub_type_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["statistic_sub_type_id"], name: "index_statistic_type_sub_types_on_statistic_sub_type_id"
|
|
|
|
t.index ["statistic_type_id"], name: "index_statistic_type_sub_types_on_statistic_type_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "statistic_types", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "statistic_index_id"
|
|
|
|
t.string "key"
|
|
|
|
t.string "label"
|
|
|
|
t.boolean "graph"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.boolean "simple"
|
|
|
|
t.index ["statistic_index_id"], name: "index_statistic_types_on_statistic_index_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "stylesheets", id: :serial, force: :cascade do |t|
|
|
|
|
t.text "contents"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "name"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "subscriptions", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "plan_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2018-12-10 13:24:00 +01:00
|
|
|
t.datetime "expiration_date"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "canceled_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "statistic_profile_id"
|
2021-10-14 18:20:10 +02:00
|
|
|
t.datetime "start_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["plan_id"], name: "index_subscriptions_on_plan_id"
|
|
|
|
t.index ["statistic_profile_id"], name: "index_subscriptions_on_statistic_profile_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "tags", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["name"], name: "index_tags_on_name", unique: true
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "themes", id: :serial, force: :cascade do |t|
|
2019-09-17 14:48:06 +02:00
|
|
|
t.string "name", null: false
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "tickets", id: :serial, 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
|
|
|
|
t.index ["event_price_category_id"], name: "index_tickets_on_event_price_category_id"
|
|
|
|
t.index ["reservation_id"], name: "index_tickets_on_reservation_id"
|
2016-08-25 18:41:33 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "trainings", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "name"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "nb_total_places"
|
|
|
|
t.string "slug"
|
|
|
|
t.text "description"
|
|
|
|
t.boolean "public_page", default: true
|
|
|
|
t.boolean "disabled"
|
|
|
|
t.index ["slug"], name: "index_trainings_on_slug", unique: true
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "trainings_availabilities", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "training_id"
|
|
|
|
t.integer "availability_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["availability_id"], name: "index_trainings_availabilities_on_availability_id"
|
|
|
|
t.index ["training_id"], name: "index_trainings_availabilities_on_training_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "trainings_machines", id: :serial, force: :cascade do |t|
|
2016-03-23 18:39:41 +01:00
|
|
|
t.integer "training_id"
|
|
|
|
t.integer "machine_id"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["machine_id"], name: "index_trainings_machines_on_machine_id"
|
|
|
|
t.index ["training_id"], name: "index_trainings_machines_on_training_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "trainings_pricings", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "group_id"
|
|
|
|
t.integer "amount"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.integer "training_id"
|
|
|
|
t.index ["group_id"], name: "index_trainings_pricings_on_group_id"
|
|
|
|
t.index ["training_id"], name: "index_trainings_pricings_on_training_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "user_tags", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "tag_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["tag_id"], name: "index_user_tags_on_tag_id"
|
|
|
|
t.index ["user_id"], name: "index_user_tags_on_user_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "users", id: :serial, force: :cascade do |t|
|
|
|
|
t.string "email", default: "", null: false
|
|
|
|
t.string "encrypted_password", default: "", null: false
|
|
|
|
t.string "reset_password_token"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "reset_password_sent_at"
|
|
|
|
t.datetime "remember_created_at"
|
2020-03-24 16:45:27 +01: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"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "confirmation_token"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "confirmed_at"
|
|
|
|
t.datetime "confirmation_sent_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.string "unconfirmed_email"
|
|
|
|
t.integer "failed_attempts", default: 0, null: false
|
|
|
|
t.string "unlock_token"
|
2015-05-05 03:10:25 +02:00
|
|
|
t.datetime "locked_at"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.boolean "is_allow_contact", default: true
|
|
|
|
t.integer "group_id"
|
|
|
|
t.string "username"
|
|
|
|
t.string "slug"
|
|
|
|
t.boolean "is_active", default: true
|
|
|
|
t.string "provider"
|
|
|
|
t.string "uid"
|
|
|
|
t.string "auth_token"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "merged_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.boolean "is_allow_newsletter"
|
2020-04-08 12:58:59 +02:00
|
|
|
t.inet "current_sign_in_ip"
|
|
|
|
t.inet "last_sign_in_ip"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["auth_token"], name: "index_users_on_auth_token"
|
|
|
|
t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true
|
|
|
|
t.index ["email"], name: "index_users_on_email", unique: true
|
|
|
|
t.index ["group_id"], name: "index_users_on_group_id"
|
|
|
|
t.index ["provider"], name: "index_users_on_provider"
|
|
|
|
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
|
|
|
t.index ["slug"], name: "index_users_on_slug", unique: true
|
|
|
|
t.index ["uid"], name: "index_users_on_uid"
|
|
|
|
t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
|
|
|
|
t.index ["username"], name: "index_users_on_username", unique: true
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "users_credits", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "credit_id"
|
|
|
|
t.integer "hours_used"
|
2016-03-23 18:39:41 +01:00
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["credit_id"], name: "index_users_credits_on_credit_id"
|
|
|
|
t.index ["user_id"], name: "index_users_credits_on_user_id"
|
2016-03-23 18:39:41 +01:00
|
|
|
end
|
|
|
|
|
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"
|
2020-03-24 16:45:27 +01:00
|
|
|
t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "wallet_transactions", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "wallet_id"
|
|
|
|
t.string "transaction_type"
|
|
|
|
t.integer "amount"
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.integer "invoicing_profile_id"
|
|
|
|
t.index ["invoicing_profile_id"], name: "index_wallet_transactions_on_invoicing_profile_id"
|
|
|
|
t.index ["wallet_id"], name: "index_wallet_transactions_on_wallet_id"
|
2016-07-04 19:20:10 +02:00
|
|
|
end
|
|
|
|
|
2020-03-24 16:45:27 +01:00
|
|
|
create_table "wallets", id: :serial, force: :cascade do |t|
|
|
|
|
t.integer "amount", default: 0
|
|
|
|
t.datetime "created_at", null: false
|
|
|
|
t.datetime "updated_at", null: false
|
|
|
|
t.integer "invoicing_profile_id"
|
|
|
|
t.index ["invoicing_profile_id"], name: "index_wallets_on_invoicing_profile_id"
|
2016-07-18 18:16:54 +02:00
|
|
|
end
|
|
|
|
|
2019-02-12 14:45:21 +01:00
|
|
|
add_foreign_key "accounting_periods", "users", column: "closed_by"
|
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"
|
2019-06-03 16:51:43 +02:00
|
|
|
add_foreign_key "history_values", "invoicing_profiles"
|
2018-12-17 16:02:02 +01:00
|
|
|
add_foreign_key "history_values", "settings"
|
2019-12-02 15:53:24 +01:00
|
|
|
add_foreign_key "i_calendar_events", "i_calendars"
|
2016-08-03 17:25:00 +02:00
|
|
|
add_foreign_key "invoices", "coupons"
|
2019-05-28 16:02:55 +02:00
|
|
|
add_foreign_key "invoices", "invoicing_profiles"
|
2019-06-12 12:22:38 +02:00
|
|
|
add_foreign_key "invoices", "invoicing_profiles", column: "operator_profile_id"
|
2019-06-11 10:02:48 +02:00
|
|
|
add_foreign_key "invoices", "statistic_profiles"
|
2016-07-20 15:07:43 +02:00
|
|
|
add_foreign_key "invoices", "wallet_transactions"
|
2019-05-28 16:02:55 +02:00
|
|
|
add_foreign_key "invoicing_profiles", "users"
|
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"
|
2019-05-28 16:02:55 +02:00
|
|
|
add_foreign_key "organizations", "invoicing_profiles"
|
2021-10-14 18:20:10 +02:00
|
|
|
add_foreign_key "payment_gateway_objects", "payment_gateway_objects"
|
|
|
|
add_foreign_key "payment_schedule_items", "invoices"
|
|
|
|
add_foreign_key "payment_schedule_items", "payment_schedules"
|
|
|
|
add_foreign_key "payment_schedule_objects", "payment_schedules"
|
|
|
|
add_foreign_key "payment_schedules", "coupons"
|
|
|
|
add_foreign_key "payment_schedules", "invoicing_profiles"
|
|
|
|
add_foreign_key "payment_schedules", "invoicing_profiles", column: "operator_profile_id"
|
|
|
|
add_foreign_key "payment_schedules", "statistic_profiles"
|
|
|
|
add_foreign_key "payment_schedules", "wallet_transactions"
|
|
|
|
add_foreign_key "plans", "plan_categories"
|
|
|
|
add_foreign_key "prepaid_packs", "groups"
|
2016-03-23 18:39:41 +01:00
|
|
|
add_foreign_key "prices", "groups"
|
|
|
|
add_foreign_key "prices", "plans"
|
2020-04-08 12:58:59 +02:00
|
|
|
add_foreign_key "project_steps", "projects"
|
|
|
|
add_foreign_key "project_users", "projects"
|
|
|
|
add_foreign_key "project_users", "users"
|
2019-06-06 16:34:53 +02:00
|
|
|
add_foreign_key "projects", "statistic_profiles", column: "author_statistic_profile_id"
|
2020-04-08 12:58:59 +02:00
|
|
|
add_foreign_key "projects_components", "components"
|
|
|
|
add_foreign_key "projects_components", "projects"
|
|
|
|
add_foreign_key "projects_machines", "machines"
|
|
|
|
add_foreign_key "projects_machines", "projects"
|
2017-02-13 14:38:28 +01:00
|
|
|
add_foreign_key "projects_spaces", "projects"
|
|
|
|
add_foreign_key "projects_spaces", "spaces"
|
2020-04-08 12:58:59 +02:00
|
|
|
add_foreign_key "projects_themes", "projects"
|
|
|
|
add_foreign_key "projects_themes", "themes"
|
2019-06-04 16:50:23 +02:00
|
|
|
add_foreign_key "reservations", "statistic_profiles"
|
2017-02-28 16:51:56 +01:00
|
|
|
add_foreign_key "slots_reservations", "reservations"
|
|
|
|
add_foreign_key "slots_reservations", "slots"
|
|
|
|
add_foreign_key "spaces_availabilities", "availabilities"
|
|
|
|
add_foreign_key "spaces_availabilities", "spaces"
|
2016-09-05 17:16:23 +02:00
|
|
|
add_foreign_key "statistic_custom_aggregations", "statistic_types"
|
2021-10-14 18:20:10 +02:00
|
|
|
add_foreign_key "statistic_profile_prepaid_packs", "prepaid_packs"
|
|
|
|
add_foreign_key "statistic_profile_prepaid_packs", "statistic_profiles"
|
2019-06-06 12:00:21 +02:00
|
|
|
add_foreign_key "statistic_profile_trainings", "statistic_profiles"
|
|
|
|
add_foreign_key "statistic_profile_trainings", "trainings"
|
2019-06-04 13:33:00 +02:00
|
|
|
add_foreign_key "statistic_profiles", "groups"
|
2019-06-06 13:58:49 +02:00
|
|
|
add_foreign_key "statistic_profiles", "roles"
|
2019-06-04 13:33:00 +02:00
|
|
|
add_foreign_key "statistic_profiles", "users"
|
2019-06-04 16:50:23 +02:00
|
|
|
add_foreign_key "subscriptions", "statistic_profiles"
|
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"
|
2019-06-03 16:00:09 +02:00
|
|
|
add_foreign_key "wallet_transactions", "invoicing_profiles"
|
2016-07-04 19:20:10 +02:00
|
|
|
add_foreign_key "wallet_transactions", "wallets"
|
2019-06-03 16:00:09 +02:00
|
|
|
add_foreign_key "wallets", "invoicing_profiles"
|
2015-05-05 03:10:25 +02:00
|
|
|
end
|