Skip to content

Commit

Permalink
undo not needed normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelweingartner committed Jun 11, 2024
1 parent 522a6da commit 7764d2c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gnocchi/indexer/sqlalchemy_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

from gnocchi import archive_policy
from gnocchi import indexer
from gnocchi.indexer import sqlalchemy_types as types
from gnocchi import resource_type
from gnocchi import utils

Expand Down Expand Up @@ -198,7 +199,7 @@ class ResourceType(Base, GnocchiBase, resource_type.ResourceType):
name="resource_type_state_enum"),
nullable=False,
server_default="creating")
updated_at = sqlalchemy.Column(indexer.types.TimestampUTC, nullable=False,
updated_at = sqlalchemy.Column(types.TimestampUTC, nullable=False,
# NOTE(jd): We would like to use
# sqlalchemy.func.now, but we can't
# because the type of PreciseTimestamp in
Expand Down Expand Up @@ -262,12 +263,12 @@ def type(cls):
nullable=False)

creator = sqlalchemy.Column(sqlalchemy.String(255))
started_at = sqlalchemy.Column(indexer.types.TimestampUTC, nullable=False,
started_at = sqlalchemy.Column(types.TimestampUTC, nullable=False,
default=lambda: utils.utcnow())
revision_start = sqlalchemy.Column(indexer.types.TimestampUTC,
revision_start = sqlalchemy.Column(types.TimestampUTC,
nullable=False,
default=lambda: utils.utcnow())
ended_at = sqlalchemy.Column(indexer.types.TimestampUTC)
ended_at = sqlalchemy.Column(types.TimestampUTC)
user_id = sqlalchemy.Column(sqlalchemy.String(255))
project_id = sqlalchemy.Column(sqlalchemy.String(255))
original_resource_id = sqlalchemy.Column(sqlalchemy.String(255),
Expand Down Expand Up @@ -307,7 +308,7 @@ class ResourceHistory(ResourceMixin, Base, GnocchiBase):
ondelete="CASCADE",
name="fk_rh_id_resource_id"),
nullable=False)
revision_end = sqlalchemy.Column(indexer.types.TimestampUTC,
revision_end = sqlalchemy.Column(types.TimestampUTC,
nullable=False,
default=lambda: utils.utcnow())
metrics = sqlalchemy.orm.relationship(
Expand Down

0 comments on commit 7764d2c

Please sign in to comment.