mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
add db unique constraint for tags
This commit is contained in:
parent
4eeec12b67
commit
314227136e
1 changed files with 13 additions and 0 deletions
13
migrations/127_tag_name_unique.rb
Normal file
13
migrations/127_tag_name_unique.rb
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
Sequel.migration do
|
||||||
|
up {
|
||||||
|
alter_table(:tags) do
|
||||||
|
add_unique_constraint :name
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
down {
|
||||||
|
alter_table(:tags) do
|
||||||
|
drop_constraint :tags_name_key
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
Loading…
Add table
Reference in a new issue