๐Ÿ“ฆ obafemitayor / newsletter-subscription-application

๐Ÿ“„ schema.rb ยท 52 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52# 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.
#
# This file is the source Rails uses to define your schema when running `bin/rails
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
# be faster and is potentially less error prone than running all of your
# migrations from scratch. Old migrations may fail to apply correctly if those
# migrations use external dependencies or application code.
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.1].define(version: 2025_04_07_135940) do
  create_table "categories", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "name"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string "guid", limit: 36
    t.index ["guid"], name: "index_categories_on_guid", unique: true
    t.index ["name"], name: "index_categories_on_name", unique: true
  end

  create_table "customers", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.string "first_name"
    t.string "last_name"
    t.string "work_email"
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string "guid", limit: 36
    t.index ["guid"], name: "index_customers_on_guid", unique: true
    t.index ["work_email"], name: "index_customers_on_work_email", unique: true
  end

  create_table "subscriptions", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
    t.bigint "customer_id", null: false
    t.bigint "category_id", null: false
    t.datetime "deleted_at"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string "guid", limit: 36
    t.index ["category_id"], name: "index_subscriptions_on_category_id"
    t.index ["customer_id", "category_id"], name: "index_subscriptions_on_customer_and_category", unique: true
    t.index ["customer_id"], name: "index_subscriptions_on_customer_id"
    t.index ["guid"], name: "index_subscriptions_on_guid", unique: true
  end

  add_foreign_key "subscriptions", "categories"
  add_foreign_key "subscriptions", "customers"
end