rein
rein copied to clipboard
Database constraints made easy for ActiveRecord.
Is there a way to construct the following constraint? `add_exclusion_constraint :invoices, "roomd_id WITH =, daterange(start_date, end_date) WITH &&", using: :gist, name: "invoices_date_overlap"` also see: https://github.com/rails/rails/pull/40224#issue-700465388 thank you, best
`create_view` somehow overwrites the scenic gem's version, which is better.
The `add_primary_key` feature exists but isn't documented. Almost missed it...
Aims to resolve #25 Adds a schema dumper to add constraints to `db/schema.rb`, so that this gem can be used without having to switch to `structure.sql` ## TODO: - [...
run migration with any constraint. schema.rb is never updated with said constraints
With ActiveRecord 4.2.10, when running this line in a migration: ``` add_null_constraint :ews_students, :first_name, if: "last_name IS NULL" ``` ... the following occurs: ``` undefined method `match?' for /^".*"$/:Regexp Did...
# Description If I try and add a length constraint to a table whose name is given with an explicit schema, the generate SQL is not valid: ``` add_length_constraint 'myschema.my_relations',...
Hi! Thanks for this gem and thanks for your continued maintenance of it! It's super valuable. However I almost missed it when [searching for "constraints" on Rubygems](https://rubygems.org/search?utf8=✓&query=constraints). (Fortunately, later I...
Hi, I want some constraints to json just like [this](https://blog.hagander.net/json-field-constraints-228/). Unfortunately, current version can not receive something like `jsontable(((j->>'uuid')::uuid))` because of this wrapper. https://github.com/nullobject/rein/blob/f5298945754aa7dee9bd142218208dcb2164a16a/lib/rein/util.rb#L17-L21 If you don't mind, I want...
Encountered this bug when using rein to add a presence constraint on a column that is using the data type `jsonb`. Screenshot of the error message is as follows: ![image...