Skip to content

Commit 70440ca

Browse files
committed
Renamed create to create_table
1 parent ddc890e commit 70440ca

File tree

23 files changed

+41
-40
lines changed

23 files changed

+41
-40
lines changed

CHANGES

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.7.0
2+
=====
3+
Renamed `create` to `create_table`, and can register commands via
4+
`piccolo_conf`.
5+
16
0.6.1
27
=====
38
Adding missing __init__.py files.

docs/src/piccolo/migrations/create.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ forwards and backwards functions.
5151
transaction = Band._meta.db.transaction()
5252
5353
transaction.add(
54-
Band.create(),
54+
Band.create_table(),
5555
)
5656
5757
await transaction.run()
@@ -78,7 +78,7 @@ This is a **bad example**:
7878
transaction = Band._meta.db.transaction()
7979
8080
transaction.add(
81-
Band.create(),
81+
Band.create_table(),
8282
)
8383
8484
await transaction.run()

docs/src/piccolo/query_types/create.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ This creates the table and columns in the database.
77

88
.. code-block:: python
99
10-
>>> Band.create().run_sync()
10+
>>> Band.create_table().run_sync()
1111
[]
1212
13-
Alternatively, you can use ``create_without_columns``, which just creates the
14-
table, without any columns.
13+
Alternatively, you can use ``create_table_without_columns``, which just
14+
creates the table, without any columns.
1515

1616
.. code-block:: python
1717
18-
>>> Band.create_without_columns().run_sync()
18+
>>> Band.create_table_without_columns().run_sync()
1919
[]
2020
2121
.. hint:: It is typically used in conjunction with migrations - see :ref:`Migrations`.

docs/src/piccolo/query_types/transactions.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ Usage
1414
.. code-block:: python
1515
1616
transaction = Band._meta.db.transaction()
17-
transaction.add(Manager.create())
18-
transaction.add(Concert.create())
17+
transaction.add(Manager.create_table())
18+
transaction.add(Concert.create_table())
1919
await transaction.run()

piccolo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__VERSION__ = "0.6.1"
1+
__VERSION__ = "0.7.0"

piccolo/commands/migration/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def create_migration_table(self) -> bool:
1818
depending on whether it was created or not.
1919
"""
2020
if not Migration.table_exists().run_sync():
21-
Migration.create().run_sync()
21+
Migration.create_table().run_sync()
2222
return True
2323
return False
2424

piccolo/commands/playground.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def populate():
4848

4949
for _table in TABLES:
5050
try:
51-
_table.create().run_sync()
51+
_table.create_table().run_sync()
5252
except Exception as e:
5353
print(e)
5454

piccolo/engine/postgres.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Transaction:
7070
Usage:
7171
7272
transaction = engine.Transaction()
73-
transaction.add(Foo.create())
73+
transaction.add(Foo.create_table())
7474
transaction.run_sync()
7575
"""
7676

piccolo/extensions/user/migrations/2019-11-14T21:52:21.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class BaseUser(Table, tablename="piccolo_user"):
1414

1515

1616
async def forwards():
17-
await BaseUser.create().run()
17+
await BaseUser.create_table().run()
1818

1919

2020
async def backwards():

piccolo/migrations/templates/migration.py.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async def forwards():
2323

2424
transaction.add(
2525
{% for table in tables %}
26-
{{ table.__name__ }}.create(),
26+
{{ table.__name__ }}.create_table(),
2727
{% endfor %}
2828
)
2929

0 commit comments

Comments
 (0)