Created
February 28, 2025 13:18
-
-
Save wilyJ80/a478f202ab3334d30115d5b040c6a2e3 to your computer and use it in GitHub Desktop.
connect-pg-simple cookie table in node-pg-migrate syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.shorthands = undefined; | |
exports.up = (pgm) => { | |
pgm.createTable("session", { | |
sid: { type: "varchar", notNull: true, primaryKey: true }, | |
sess: { type: "json", notNull: true }, | |
expire: { type: "timestamp(6)", notNull: true }, | |
}); | |
pgm.createIndex("session", "expire", { name: "IDX_session_expire" }); | |
}; | |
exports.down = (pgm) => { | |
pgm.dropIndex("session", "expire", { ifExists: true }); | |
pgm.dropTable("session", { ifExists: true }); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment