Skip to content

Commit

Permalink
fix: make transactions table ID autoincrement
Browse files Browse the repository at this point in the history
  • Loading branch information
rolznz committed Jul 15, 2024
1 parent e297251 commit 68cb985
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions db/migrations/202407012100_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (

// This migration
// - Replaces the old payments table with a new transactions table
// - Adds new properties to app_permissions
// - balance_type string - isolated | full
// - visibility string - isolated | full
// - Adds new properties to apps
// - isolated boolean
//
// - Renames max amount on app permissions to be clear its in sats
var _202407012100_transactions = &gormigrate.Migration{
Expand All @@ -20,7 +19,7 @@ var _202407012100_transactions = &gormigrate.Migration{

if err := tx.Exec(`
CREATE TABLE transactions(
id integer,
id integer PRIMARY KEY AUTOINCREMENT,
app_id integer,
request_event_id integer,
type text,
Expand All @@ -37,8 +36,7 @@ CREATE TABLE transactions(
updated_at datetime,
expires_at datetime,
settled_at datetime,
metadata text,
PRIMARY KEY (id)
metadata text
);
DROP TABLE payments;
Expand Down

0 comments on commit 68cb985

Please sign in to comment.