db-schema / core Goto Github PK
View Code? Open in Web Editor NEWDeclarative database schema definition
License: MIT License
Declarative database schema definition
License: MIT License
Postgres allows renaming indexes, and while it is impossible to use inside the schema diffing algorithm (as indexes are compared by name) it can still be used inside conditional migrations.
Adding an Operations::RenameIndex
(and respective rename_index
in the Migrator
) and handling it with execute('ALTER INDEX name RENAME TO new_name')
in the Reader
should do it.
If the database schema contains any check constraints that mention an enum field, then running AlterEnumValues
against that enum type fails.
A possible solution would be to drop check constraints before recreating the enum and create them back afterwards.
Cloud Firestore is a very popular and useful database. It would be nice if you include it
Hello!
I like your idea and I want to help.
Reordering and deleting values from enum types is not supported.
You can do it!
Sequel migration example:
Sequel.migration do
no_transaction
up do
add_enum_value(:enum_locale, 'fr')
end
down do
enum_values = schema(:users).to_h[:locale][:enum_values]
alter_table :users do
set_column_type :locale, String
end
self[:users].where(locale: 'fr').update(locale: 'en')
drop_enum :enum_locale
create_enum :enum_locale, enum_values - %w(fr)
alter_table table do
set_column_type(
:locale,
:enum_locale,
using: 'locale::enum_locale'
)
end
end
end
A temporary table created in Normalizer can depend on enums and/or extensions that may not exist yet (for example when applying the schema to an empty database).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.