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

Implement comments #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions migra/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"collations",
"rlspolicies",
"triggers",
"comments",
]
PK = "PRIMARY KEY"

Expand Down
1 change: 1 addition & 0 deletions migra/migra.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def add_all_changes(self, privileges=False):
self.add(self.changes.rlspolicies(creations_only=True))
self.add(self.changes.triggers(creations_only=True))
self.add(self.changes.collations(drops_only=True))
self.add(self.changes.comments(creations_only=True))
self.add(self.changes.schemas(drops_only=True))

@property
Expand Down
1 change: 1 addition & 0 deletions tests/FIXTURES/comments/a.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
create table example0 (a int);
Empty file.
5 changes: 5 additions & 0 deletions tests/FIXTURES/comments/b.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
create table example (a int);

comment on table example is 'Example table';

comment on column example.a is 'Example column';
10 changes: 10 additions & 0 deletions tests/FIXTURES/comments/expected.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
drop table "public"."example0";

create table "public"."example" (
"a" integer
);


comment on column "public"."example"."a" is 'Example column';

comment on table "public"."example" is 'Example table';
Empty file.
1 change: 1 addition & 0 deletions tests/test_migra.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def test_singleschema_ext():

fixtures = """\
everything
comments
collations
identitycols
partitioning
Expand Down