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
Add a column name: text to table class, change student.class to ref class.name
CREATETABLE "student"
(
id integernot nullconstraint student_pk
primary key autoincrement,
class textnot nullconstraint class
references class (name)
onupdate cascade on delete cascade
)
Exec sea-orm-cli generate entity -u sqlite:///path/to/test1.db -o test again. SUCCESS!
Expected Behavior
sea-orm-cli can handle relations with foreign keys point to column id.
Actual Behavior
Now cli can not handle.
Reproduces How Often
Every time in my tries.
Versions
sea-orm-cli v0.7.1
Additional Information
The text was updated successfully, but these errors were encountered:
Description
I'm trying to build my own ledger program. I have some tables with foreign keys, but when executing
sea-orm-cli
I come across this error:I take a look at the source code and it seems right:
So I assume it may correspond to the structure of tables in sqlite. I create a new database with simple tables to try again:
Steps to Reproduce
Exec
sqlite3 test1.db "VACUUM;"
to create a new empty databaseUse DataGrip to create two tables:
class(id)
andstudent(id, class)
.student.class
is foreign key, refclass.id
Exec
sea-orm-cli generate entity -u sqlite:///path/to/test1.db -o test
. ERROR occurred!Add a column
name: text
to tableclass
, changestudent.class
to refclass.name
Exec
sea-orm-cli generate entity -u sqlite:///path/to/test1.db -o test
again. SUCCESS!Expected Behavior
sea-orm-cli
can handle relations with foreign keys point to columnid
.Actual Behavior
Now cli can not handle.
Reproduces How Often
Every time in my tries.
Versions
Additional Information
The text was updated successfully, but these errors were encountered: