Adding created_on field to migrations table
1 files changed, 5 insertions(+), 1 deletions(-)

M migrate.go
M migrate.go +5 -1
@@ 198,7 198,11 @@ func (me *MigrationEngine) printf(format
 
 func (me *MigrationEngine) createMigrationTable(ctx context.Context) error {
 	err := withTx(ctx, nil, func(tx *sql.Tx) error {
-		_, err := tx.ExecContext(ctx, "CREATE TABLE IF NOT EXISTS migrations (id TEXT PRIMARY KEY)")
+		_, err := tx.ExecContext(ctx, `
+		CREATE TABLE IF NOT EXISTS migrations (
+			id TEXT PRIMARY KEY,
+			created_on TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
+		)`)
 		if err != nil {
 			return fmt.Errorf("creating migrations table: %w", err)
 		}