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
@tyt2y3 It seems like foreign keys created for sqlite by sea orm are unnamed. So this method should panic for sqlite?
EDIT:
If you don't explicitly name a foreign key constraint, SQLite will generate a name for it automatically. The automatically generated name will be in the form sqlite_autoindex_tablename_N, where tablename is the name of the table the foreign key belongs to, and N is a number that makes the name unique within the database.
Motivation
The
SchemaManager
has convenience methods likehas_table
andhas_column
while writing migrations. I propose ahas_constraint
method.Proposed Solutions
It will return
true
if an constraint exists for a given table.Current Workarounds
Execute the query manually.
If accepted I would like to make a PR.
The text was updated successfully, but these errors were encountered: