bank_transaction_acc_trans: überflüssige Spalte »id« entfernt
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 2 Sep 2019 10:11:04 +0000 (12:11 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 2 Sep 2019 10:26:00 +0000 (12:26 +0200)
Primärschlüssel sind zwei andere Spalten, und die Präsenz dieser
Nicht-Primärschlüssel-Spalte zusammen mit Typ »serial« macht Probleme,
weil Rose kein Default für solche Spalten kennt.

SL/DB/MetaSetup/BankTransactionAccTrans.pm
sql/Pg-upgrade2/bank_transaction_acc_trans_remove_wrong_primary_key.sql [new file with mode: 0644]

index 5055ca4..b4ba2e2 100644 (file)
@@ -14,7 +14,6 @@ __PACKAGE__->meta->columns(
   ar_id               => { type => 'integer' },
   bank_transaction_id => { type => 'integer', not_null => 1 },
   gl_id               => { type => 'integer' },
-  id                  => { type => 'serial', not_null => 1 },
   itime               => { type => 'timestamp', default => 'now()' },
   mtime               => { type => 'timestamp' },
 );
diff --git a/sql/Pg-upgrade2/bank_transaction_acc_trans_remove_wrong_primary_key.sql b/sql/Pg-upgrade2/bank_transaction_acc_trans_remove_wrong_primary_key.sql
new file mode 100644 (file)
index 0000000..8b27647
--- /dev/null
@@ -0,0 +1,5 @@
+-- @tag: bank_transaction_acc_trans_remove_wrong_primary_key
+-- @description: bank_transaction_acc_trans_remove_wrong_primary_key
+-- @depends: release_3_5_4
+ALTER TABLE bank_transaction_acc_trans
+DROP COLUMN id;