I'm working in an application that's currently switching from surrealdb to regular postgres using the sea-orm crate, but the cli is failing to find anything. I'm not sure what I'm doing wrong, as I'm setting the schema path and the output path properly, but it generates a file with only the comment saying this was auto generated. The file does not include any generated rust code.
This is the output of the file:
//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.0
And this is my schema:
--
-- Notes
--
CREATE TABLE mdx_note (
id SERIAL PRIMARY KEY,
-- Not varchar to allow for an indefinite length.
file_path TEXT,
-- The notes raw mdx content with the front matter removed.
raw_body TEXT,
-- The time the file was created.
ctime TIMESTAMP,
-- The time the file was last modified.
mtime DATETIME,
-- The time of last access. This might be unreliable if the file is being accessed as part of the sync script.
atime DATETIME,
);
--
-- Bibliography
--
CREATE TABLE reading_list (
id SERIAL PRIMARY KEY,
);
CREATE TABLE reading_list_bib_entry_join (
id SERIAL PRIMARY KEY,
bib_entry_id INT,
CONSTRAINT fk_bib_entry
FOREIGN KEY(bib_entry_id)
REFERENCES bib_entry(id)
reading_list_id INT,
CONSTRAINT fk_reading_list
FOREIGN KEY(reading_list_id)
REFERENCES reading_list(id)
);
CREATE TABLE bib_entry (
id SERIAL PRIMARY KEY,
-- The notes raw mdx content with the front matter removed.
data JSON,
);
Obviously that schema is going to grow quite a bit, but I wanted to get the code generation working before I moved the rest of the schema from surrealql to postgres.
And this is the command I'm running
sea-orm-cli generate entity -u ${FLUSTER_DB_URI} -o ${FLUSTER_NATIVE_ROOT}/packages/fluster_db/src/migrations -s ${FLUSTER_NATIVE_ROOT}/packages/fluster_db/src/api/schema/schema.sql
Any help is greatly appreciated.