mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 23:41:17 -05:00
Update FactBilling model to reflect current database state
The FactBilling model and the ft_billing database table have diverged
slightly - this makes some minor changes to the model columns so that
the model matches the table (which appears to be the correct version).
The ft_billing table is currently like this:
Column | Type | Modifiers | Storage | Stats target | Description
--------------------+-----------------------------+-----------+----------+--------------+-------------
bst_date | date | not null | plain | |
template_id | uuid | not null | plain | |
service_id | uuid | not null | plain | |
notification_type | text | not null | extended | |
provider | text | not null | extended | |
rate_multiplier | integer | not null | plain | |
international | boolean | not null | plain | |
rate | numeric | not null | main | |
billable_units | integer | | plain | |
notifications_sent | integer | | plain | |
updated_at | timestamp without time zone | | plain | |
created_at | timestamp without time zone | not null | plain | |
Indexes:
"ft_billing_pkey" PRIMARY KEY, btree (bst_date, template_id, service_id, rate_multiplier, provider, notification_type, international, rate)
"ix_ft_billing_bst_date" btree (bst_date)
"ix_ft_billing_service_id" btree (service_id)
"ix_ft_billing_template_id" btree (template_id)
This commit is contained in:
@@ -1805,12 +1805,12 @@ class FactBilling(db.Model):
|
||||
|
||||
bst_date = db.Column(db.Date, nullable=False, primary_key=True, index=True)
|
||||
template_id = db.Column(UUID(as_uuid=True), nullable=False, primary_key=True, index=True)
|
||||
service_id = db.Column(UUID(as_uuid=True), nullable=False, index=True)
|
||||
service_id = db.Column(UUID(as_uuid=True), nullable=False, primary_key=True, index=True)
|
||||
notification_type = db.Column(db.Text, nullable=False, primary_key=True)
|
||||
provider = db.Column(db.Text, nullable=True, primary_key=True)
|
||||
rate_multiplier = db.Column(db.Integer(), nullable=True, primary_key=True)
|
||||
international = db.Column(db.Boolean, nullable=False, primary_key=False)
|
||||
rate = db.Column(db.Numeric(), nullable=False)
|
||||
provider = db.Column(db.Text, nullable=False, primary_key=True)
|
||||
rate_multiplier = db.Column(db.Integer(), nullable=False, primary_key=True)
|
||||
international = db.Column(db.Boolean, nullable=False, primary_key=True)
|
||||
rate = db.Column(db.Numeric(), nullable=False, primary_key=True)
|
||||
billable_units = db.Column(db.Integer(), nullable=True)
|
||||
notifications_sent = db.Column(db.Integer(), nullable=True)
|
||||
created_at = db.Column(db.DateTime, nullable=False, default=datetime.datetime.utcnow)
|
||||
|
||||
Reference in New Issue
Block a user