-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increase collection item max len (#2661)
* Increase collection item max len * Rename table --------- Co-authored-by: Stuart Corbishley <corbish@gmail.com>
- Loading branch information
Showing
8 changed files
with
99 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
priv/repo/migrations/20241112150001_increase_collections_items.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
defmodule Lightning.Repo.Migrations.IncreaseCollectionsItems do | ||
use Ecto.Migration | ||
|
||
def change do | ||
alter table(:collections_items, primary_key: false) do | ||
modify :value, :string, size: 1_000_000, from: {:string, size: 255} | ||
end | ||
end | ||
end |
37 changes: 37 additions & 0 deletions
37
priv/repo/migrations/20241113111034_rename_collection_items_table.exs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
defmodule Lightning.Repo.Migrations.RenameCollectionItemsTable do | ||
use Ecto.Migration | ||
|
||
def change do | ||
rename table(:collections_items), to: table(:collection_items) | ||
|
||
execute """ | ||
ALTER INDEX collections_items_key_trgm_idx RENAME TO collection_items_key_trgm_idx | ||
""", | ||
""" | ||
ALTER INDEX collection_items_key_trgm_idx RENAME TO collections_items_key_trgm_idx | ||
""" | ||
|
||
execute """ | ||
ALTER INDEX collections_items_collection_id_key_index RENAME TO collection_items_collection_id_key_index | ||
""", | ||
""" | ||
ALTER INDEX collection_items_collection_id_key_index RENAME TO collections_items_collection_id_key_index | ||
""" | ||
|
||
execute """ | ||
ALTER INDEX collections_items_updated_at_index RENAME TO collection_items_updated_at_index | ||
""", | ||
""" | ||
ALTER INDEX collection_items_updated_at_index RENAME TO collections_items_updated_at_index | ||
""" | ||
|
||
execute """ | ||
ALTER TABLE collection_items DROP CONSTRAINT collections_items_collection_id_fkey, | ||
ADD CONSTRAINT collection_items_collection_id_fkey FOREIGN KEY (collection_id) REFERENCES collections(id) ON DELETE CASCADE | ||
""", | ||
""" | ||
ALTER TABLE collection_item DROP CONSTRAINT collection_items_collection_id_fkey, | ||
ADD CONSTRAINT collections_items_collection_id_fkey FOREIGN KEY (collection_id) REFERENCES collections(id) ON DELETE CASCADE | ||
""" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters