Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for using PostgreSQL #2467

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

matrss
Copy link
Collaborator

@matrss matrss commented Aug 16, 2024

Created enum types should also be dropped on downgrade. Dropping tables must be committed to become visible.

Purpose of PR?:

Fixes #

Does this PR introduce a breaking change?

If the changes in this PR are manually verified, list down the scenarios covered::

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Does this PR results in some Documentation changes?
If yes, include the list of Documentation changes

Checklist:

  • Bug fix. Fixes #
  • New feature (Non-API breaking changes that adds functionality)
  • PR Title follows the convention of <type>: <subject>
  • Commit has unit tests

Created enum types should also be dropped on downgrade. Dropping tables
must be committed to become visible.
@matrss matrss requested a review from ReimarBauer August 16, 2024 13:33
Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect that his works. I can verify this again later when we have merged both to develop.

op.drop_table('messages')
sa.Enum(name='messagetype').drop(op.get_bind(), checkfirst=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just looked into the model definition: "message_type"

Copy link
Collaborator Author

@matrss matrss Aug 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The column that uses the type is called message_type, but the enum type in the database is created with the name messagetype. You can see that here:

sa.Column('message_type', sa.Enum('TEXT', 'SYSTEM_MESSAGE', 'IMAGE', 'DOCUMENT', name='messagetype'), nullable=True),
, the relevant part being name='messagetype'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it derives that name from simply lowercasing the class name of the enum defined here:

class MessageType(enum.IntEnum):

@ReimarBauer ReimarBauer self-requested a review August 21, 2024 13:21
Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is "message_type" please double check

Copy link
Member

@ReimarBauer ReimarBauer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thx.

@matrss matrss merged commit 4344e00 into Open-MSS:develop Aug 22, 2024
10 of 11 checks passed
@matrss matrss deleted the fixes-for-postgresql branch August 22, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants