It's unfortunate the sqlite schema uses AUTOINCREMENT, since this is not supported in duckdb (which is fine!).
duckdb/duckdb#15436
For background, see:
https://duckdb.org/docs/stable/sql/statements/create_sequence
https://duckdb.org/docs/stable/sql/constraints
But I want to use goose with duckdb, and so we should figure out how to get this to work.
To support DuckDB, the version table creation needs to use sequences:
CREATE SEQUENCE IF NOT EXISTS goose_db_version_id_seq START 1;
CREATE TABLE goose_db_version (
id INTEGER PRIMARY KEY DEFAULT nextval('goose_db_version_id_seq'),
version_id INTEGER NOT NULL,
is_applied INTEGER NOT NULL,
tstamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Can't use the other dialects because:
- No
AUTOINCREMENT (SQLite)
- No
GENERATED BY DEFAULT AS IDENTITY (Postgres)
It's unfortunate the sqlite schema uses AUTOINCREMENT, since this is not supported in duckdb (which is fine!).
duckdb/duckdb#15436
For background, see:
https://duckdb.org/docs/stable/sql/statements/create_sequence
https://duckdb.org/docs/stable/sql/constraints
But I want to use goose with duckdb, and so we should figure out how to get this to work.
To support DuckDB, the version table creation needs to use sequences:
Can't use the other dialects because:
AUTOINCREMENT(SQLite)GENERATED BY DEFAULT AS IDENTITY(Postgres)