-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Description
❯ cat ./drizzle/example.sql
CREATE TABLE IF NOT EXISTS "dogs" (
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "dogs_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
"name" varchar(255) NOT NULL,
"age" integer NOT NULL
);
-- comment
CREATE INDEX IF NOT EXISTS "name" ON "dogs" USING btree ("name");
❯ pgroll convert ./drizzle/example.sql
{
"name": "20250313162406",
"operations": [
{
"sql": {
"up": "CREATE TABLE IF NOT EXISTS \"dogs\" (\n\t\"id\" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name \"dogs_id_seq\" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),\n\t\"name\" varchar(255) NOT NULL,\n\t\"age\" integer NOT NULL\n)"
}
},
{
"sql": {
"up": "-- comment\nCREATE INDEX IF NOT EXISTS \"name\" ON \"dogs\" USING btree (\"name\")"
}
}
]
}
Drizzle leaves comments in it's generated SQL.
Metadata
Metadata
Assignees
Labels
No labels