table change

This commit is contained in:
CHIEFSOFT\ameye
2025-04-05 23:30:48 -04:00
parent 7b0d19c0e0
commit 31ffbe686a
+8 -3
View File
@@ -4,8 +4,13 @@ from sqlalchemy.exc import IntegrityError
class Transaction(db.Model): class Transaction(db.Model):
__tablename__ = 'transactions' __tablename__ = 'transactions'
id =db.db.Column(
id = db.Column(db.String(50), primary_key=True) db.Integer,
primary_key=True,
autoincrement=True,
)
#id = db.Column(db.Int, primary_key=True)
transaction_id = db.Column(db.String(50), nullable=False)
account_id = db.Column(db.String(50), nullable=False) account_id = db.Column(db.String(50), nullable=False)
type = db.Column(db.String(50), nullable=False) type = db.Column(db.String(50), nullable=False)
channel = db.Column(db.String(50), nullable=False) channel = db.Column(db.String(50), nullable=False)
@@ -22,7 +27,7 @@ class Transaction(db.Model):
raise ValueError("Duplicate Transaction") raise ValueError("Duplicate Transaction")
transaction = cls( transaction = cls(
id=id, transaction_id=id,
account_id=account_id, account_id=account_id,
type=type, type=type,
channel=channel channel=channel