mirror of
https://github.com/czhu12/canine.git
synced 2026-01-06 11:40:44 -06:00
added unique index to build id
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
# Table name: build_configurations
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# build_type :integer default(0), not null
|
||||
# driver :integer not null
|
||||
# image_repository :string not null
|
||||
# created_at :datetime not null
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_deployments_on_build_id (build_id)
|
||||
# index_deployments_on_build_id (build_id) UNIQUE
|
||||
#
|
||||
# Foreign Keys
|
||||
#
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class AddUniqueIndexToBuildId < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
remove_index :deployments, :build_id
|
||||
add_index :deployments, :build_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.
|
||||
|
||||
ActiveRecord::Schema[7.2].define(version: 2025_09_02_182502) do
|
||||
ActiveRecord::Schema[7.2].define(version: 2025_09_04_022903) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
@@ -150,7 +150,7 @@ ActiveRecord::Schema[7.2].define(version: 2025_09_02_182502) do
|
||||
t.integer "status", default: 0, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["build_id"], name: "index_deployments_on_build_id"
|
||||
t.index ["build_id"], name: "index_deployments_on_build_id", unique: true
|
||||
end
|
||||
|
||||
create_table "domains", force: :cascade do |t|
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Table name: build_configurations
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# build_type :integer default(0), not null
|
||||
# driver :integer not null
|
||||
# image_repository :string not null
|
||||
# created_at :datetime not null
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_deployments_on_build_id (build_id)
|
||||
# index_deployments_on_build_id (build_id) UNIQUE
|
||||
#
|
||||
# Foreign Keys
|
||||
#
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
# Table name: build_configurations
|
||||
#
|
||||
# id :bigint not null, primary key
|
||||
# build_type :integer default(0), not null
|
||||
# driver :integer not null
|
||||
# image_repository :string not null
|
||||
# created_at :datetime not null
|
||||
|
||||
Reference in New Issue
Block a user