Skip to content

Version SQL functions to v1#30

Open
crystarm wants to merge 1 commit intouserver-framework:developfrom
crystarm:feature/sql-function-versioning
Open

Version SQL functions to v1#30
crystarm wants to merge 1 commit intouserver-framework:developfrom
crystarm:feature/sql-function-versioning

Conversation

@crystarm
Copy link
Copy Markdown
Contributor


Note: by creating a PR or an issue you automatically agree to the CLA. See CONTRIBUTING.md. Feel free to remove this note, the agreement holds.

Copy link
Copy Markdown
Member

@apolukhin apolukhin left a comment

Choose a reason for hiding this comment

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

This is a sample project in wich we try to show the best practices. Versioning of SQL functions is must have option, so lets just drop the old functions

$$
LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION real_medium.create_article(_title varchar(255), _slug varchar(255), _body text, _description text, _user_id text, _tags varchar(255)[])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just use create_article_v1 directly in code and remove the create_article

LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION real_medium.get_article_with_author_profile_by_slug(_slug varchar(255), _follower_id text = NULL)
CREATE OR REPLACE FUNCTION real_medium.get_article_with_author_profile(_article_id text, _follower_id text = NULL)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just use get_article_with_author_profile_v1 directly in code and remove the get_article_with_author_profile

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