mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
Family subscription unique index
This commit is contained in:
parent
9e6e4b1ce6
commit
0fb689290a
2 changed files with 8 additions and 2 deletions
|
@ -0,0 +1,6 @@
|
||||||
|
class AddUniquenessToSubscriptions < ActiveRecord::Migration[7.2]
|
||||||
|
def change
|
||||||
|
remove_index :subscriptions, :family_id
|
||||||
|
add_index :subscriptions, :family_id, unique: true
|
||||||
|
end
|
||||||
|
end
|
4
db/schema.rb
generated
4
db/schema.rb
generated
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.2].define(version: 2025_05_09_182903) do
|
ActiveRecord::Schema[7.2].define(version: 2025_05_13_122703) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "pgcrypto"
|
enable_extension "pgcrypto"
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -580,7 +580,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_05_09_182903) do
|
||||||
t.datetime "trial_ends_at"
|
t.datetime "trial_ends_at"
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
t.index ["family_id"], name: "index_subscriptions_on_family_id"
|
t.index ["family_id"], name: "index_subscriptions_on_family_id", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "syncs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
create_table "syncs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue