You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to propose adding general support for custom checks on TableDefinition methods ex. column or references
This was proposed in #170 as a mechanism to check for foreign key creations in TableDefinitions and was closed since creating foreign keys on an empty table is not a dangerous operaiton. My motivation for TableDefinition is different. I'd like to broadly restrict the schema that can be created via custom checks on TableDefinition. For example, at Figma we require folks to use bigint rather than integer columns to avoid overflow bugs. The below migration would not be allowed to run since it creates a new table with an integer column.
create_table(:photos) do |t|
t.integer :like_count
t.references :photographer, null: false, foreign_key: true, type: :uuid
end
Also full disclosure, I'm somewhat new to the ruby/rails ecosystem so please let me know if the "restrict the schema" problem would be better solved by a different tool.
The text was updated successfully, but these errors were encountered:
I'd like to propose adding general support for custom checks on TableDefinition methods ex.
column
orreferences
This was proposed in #170 as a mechanism to check for foreign key creations in TableDefinitions and was closed since creating foreign keys on an empty table is not a dangerous operaiton. My motivation for TableDefinition is different. I'd like to broadly restrict the schema that can be created via custom checks on TableDefinition. For example, at Figma we require folks to use
bigint
rather thaninteger
columns to avoid overflow bugs. The below migration would not be allowed to run since it creates a new table with an integer column.Also full disclosure, I'm somewhat new to the ruby/rails ecosystem so please let me know if the "restrict the schema" problem would be better solved by a different tool.
The text was updated successfully, but these errors were encountered: