Description: Introspection of table with SQL script as default generates invalid schema
Source table:
CREATE SEQUENCE actor_actor_id_seq
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
CREATE TABLE actor (
actor_id integer DEFAULT nextval('actor_actor_id_seq'::regclass) NOT NULL
);
Result:
export const actor = pgTable("actor", {
actor_id: integer("actor_id").default(nextval('actor_actor_id_seq'::regclass)).primaryKey().notNull()
});
Expected:
export const actor = pgTable("actor", {
actor_id: integer("actor_id").default(sql`nextval('actor_actor_id_seq'::regclass)`).primaryKey().notNull()
});
Kit:
0.21.4
Database:PostgreSQL
Description: Introspection of table with SQL script as default generates invalid schema
Source table:
Result:
Expected: