rename to aerich
This commit is contained in:
parent
00764c1b3d
commit
b767f409f4
2
.github/workflows/pypi.yml
vendored
2
.github/workflows/pypi.yml
vendored
@ -2,7 +2,7 @@ name: pypi
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
paths:
|
paths:
|
||||||
- 'alice/__init__.py'
|
- 'aerich/__init__.py'
|
||||||
- '.github/workflows/pypi.yml'
|
- '.github/workflows/pypi.yml'
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -7,4 +7,4 @@ ChangeLog
|
|||||||
===
|
===
|
||||||
0.1.1
|
0.1.1
|
||||||
-----
|
-----
|
||||||
- Now alice is basic worked.
|
- Now aerich is basic worked.
|
4
Makefile
4
Makefile
@ -1,9 +1,9 @@
|
|||||||
checkfiles = alice/ tests/
|
checkfiles = aerich/ tests/
|
||||||
black_opts = -l 100 -t py38
|
black_opts = -l 100 -t py38
|
||||||
py_warn = PYTHONDEVMODE=1
|
py_warn = PYTHONDEVMODE=1
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@echo "Alice development makefile"
|
@echo "Aerich development makefile"
|
||||||
@echo
|
@echo
|
||||||
@echo "usage: make <target>"
|
@echo "usage: make <target>"
|
||||||
@echo "Targets:"
|
@echo "Targets:"
|
||||||
|
46
README.rst
46
README.rst
@ -1,13 +1,13 @@
|
|||||||
=====
|
======
|
||||||
Alice
|
Aerich
|
||||||
=====
|
======
|
||||||
|
|
||||||
.. image:: https://img.shields.io/pypi/v/alice.svg?style=flat
|
.. image:: https://img.shields.io/pypi/v/aerich.svg?style=flat
|
||||||
:target: https://pypi.python.org/pypi/alice
|
:target: https://pypi.python.org/pypi/aerich
|
||||||
.. image:: https://img.shields.io/github/license/long2ice/alice
|
.. image:: https://img.shields.io/github/license/long2ice/aerich
|
||||||
:target: https://github.com/long2ice/alice
|
:target: https://github.com/long2ice/aerich
|
||||||
.. image:: https://github.com/long2ice/alice/workflows/pypi/badge.svg
|
.. image:: https://github.com/long2ice/aerich/workflows/pypi/badge.svg
|
||||||
:target: https://github.com/long2ice/alice/actions?query=workflow:pypi
|
:target: https://github.com/long2ice/aerich/actions?query=workflow:pypi
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
============
|
============
|
||||||
@ -19,26 +19,20 @@ This project aim to be a best migrations tool for Tortoise-ORM and which written
|
|||||||
Install
|
Install
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Just install from pypi (**INVALID**):
|
Just install from pypi:
|
||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ pip install alice
|
$ pip install aerich
|
||||||
|
|
||||||
So bad that pypi project name is occupied, you can only install from source:
|
|
||||||
|
|
||||||
.. code-block:: shell
|
|
||||||
|
|
||||||
$ pip install git+https://github.com/long2ice/alice.git
|
|
||||||
|
|
||||||
Quick Start
|
Quick Start
|
||||||
===========
|
===========
|
||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ alice -h
|
$ aerich -h
|
||||||
|
|
||||||
Usage: alice [OPTIONS] COMMAND [ARGS]...
|
Usage: aerich [OPTIONS] COMMAND [ARGS]...
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--config TEXT Tortoise-ORM config module, will auto read config dict variable
|
--config TEXT Tortoise-ORM config module, will auto read config dict variable
|
||||||
@ -65,7 +59,7 @@ Init schema and migrate location
|
|||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ alice --config tests.backends.mysql init
|
$ aerich --config tests.backends.mysql init
|
||||||
|
|
||||||
Success create migrate location ./migrations/models
|
Success create migrate location ./migrations/models
|
||||||
Success init for app "models"
|
Success init for app "models"
|
||||||
@ -75,7 +69,7 @@ Update models and make migrate
|
|||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ alice --config tests.backends.mysql migrate --name drop_column
|
$ aerich --config tests.backends.mysql migrate --name drop_column
|
||||||
|
|
||||||
Success migrate 1_202029051520102929_drop_column.json
|
Success migrate 1_202029051520102929_drop_column.json
|
||||||
|
|
||||||
@ -86,7 +80,7 @@ Upgrade to latest version
|
|||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ alice --config tests.backends.mysql upgrade
|
$ aerich --config tests.backends.mysql upgrade
|
||||||
|
|
||||||
Success upgrade 1_202029051520102929_drop_column.json
|
Success upgrade 1_202029051520102929_drop_column.json
|
||||||
|
|
||||||
@ -97,7 +91,7 @@ Downgrade to previous version
|
|||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ alice --config tests.backends.mysql downgrade
|
$ aerich --config tests.backends.mysql downgrade
|
||||||
|
|
||||||
Success downgrade 1_202029051520102929_drop_column.json
|
Success downgrade 1_202029051520102929_drop_column.json
|
||||||
|
|
||||||
@ -108,7 +102,7 @@ Show history
|
|||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ alice --config tests.backends.mysql history
|
$ aerich --config tests.backends.mysql history
|
||||||
|
|
||||||
1_202029051520102929_drop_column.json
|
1_202029051520102929_drop_column.json
|
||||||
|
|
||||||
@ -117,10 +111,10 @@ Show heads to be migrated
|
|||||||
|
|
||||||
.. code-block:: shell
|
.. code-block:: shell
|
||||||
|
|
||||||
$ alice --config tests.backends.mysql heads
|
$ aerich --config tests.backends.mysql heads
|
||||||
|
|
||||||
1_202029051520102929_drop_column.json
|
1_202029051520102929_drop_column.json
|
||||||
|
|
||||||
License
|
License
|
||||||
=======
|
=======
|
||||||
This project is licensed under the `MIT <https://github.com/long2ice/alice/blob/master/LICENSE>`_ License.
|
This project is licensed under the `MIT <https://github.com/long2ice/aerich/blob/master/LICENSE>`_ License.
|
||||||
|
@ -8,8 +8,8 @@ import asyncclick as click
|
|||||||
from asyncclick import BadOptionUsage, Context, UsageError
|
from asyncclick import BadOptionUsage, Context, UsageError
|
||||||
from tortoise import Tortoise, generate_schema_for_client
|
from tortoise import Tortoise, generate_schema_for_client
|
||||||
|
|
||||||
from alice.migrate import Migrate
|
from aerich.migrate import Migrate
|
||||||
from alice.utils import get_app_connection
|
from aerich.utils import get_app_connection
|
||||||
|
|
||||||
|
|
||||||
class Color(str, Enum):
|
class Color(str, Enum):
|
||||||
@ -145,9 +145,7 @@ def history(ctx):
|
|||||||
click.secho(version, fg=Color.yellow)
|
click.secho(version, fg=Color.yellow)
|
||||||
|
|
||||||
|
|
||||||
@cli.command(
|
@cli.command(help="Init migrate location and generate schema, you must exec first.")
|
||||||
help="Init migrate location and generate schema, you must exec first."
|
|
||||||
)
|
|
||||||
@click.option(
|
@click.option(
|
||||||
"--safe",
|
"--safe",
|
||||||
is_flag=True,
|
is_flag=True,
|
@ -4,7 +4,7 @@ from tortoise import ForeignKeyFieldInstance, Model
|
|||||||
from tortoise.backends.mysql.schema_generator import MySQLSchemaGenerator
|
from tortoise.backends.mysql.schema_generator import MySQLSchemaGenerator
|
||||||
from tortoise.fields import Field, JSONField, TextField, UUIDField
|
from tortoise.fields import Field, JSONField, TextField, UUIDField
|
||||||
|
|
||||||
from alice.ddl import BaseDDL
|
from aerich.ddl import BaseDDL
|
||||||
|
|
||||||
|
|
||||||
class MysqlDDL(BaseDDL):
|
class MysqlDDL(BaseDDL):
|
@ -9,10 +9,10 @@ from tortoise import BackwardFKRelation, ForeignKeyFieldInstance, Model, Tortois
|
|||||||
from tortoise.backends.mysql.schema_generator import MySQLSchemaGenerator
|
from tortoise.backends.mysql.schema_generator import MySQLSchemaGenerator
|
||||||
from tortoise.fields import Field
|
from tortoise.fields import Field
|
||||||
|
|
||||||
from alice.ddl import BaseDDL
|
from aerich.ddl import BaseDDL
|
||||||
from alice.ddl.mysql import MysqlDDL
|
from aerich.ddl.mysql import MysqlDDL
|
||||||
from alice.exceptions import ConfigurationError
|
from aerich.exceptions import ConfigurationError
|
||||||
from alice.utils import get_app_connection
|
from aerich.utils import get_app_connection
|
||||||
|
|
||||||
|
|
||||||
class Migrate:
|
class Migrate:
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "alice"
|
name = "aerich"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
description = "A database migrations tool for Tortoise ORM."
|
description = "A database migrations tool for Tortoise ORM."
|
||||||
authors = ["long2ice <long2ice@gmail.com>"]
|
authors = ["long2ice <long2ice@gmail.com>"]
|
||||||
|
|
||||||
|
@ -1,19 +1,31 @@
|
|||||||
#
|
aiomysql==0.0.20
|
||||||
# This file is autogenerated by pip-compile
|
aiosqlite==0.13.0
|
||||||
# To update, run:
|
anyio==1.3.0
|
||||||
#
|
appdirs==1.4.4
|
||||||
# make up
|
async-generator==1.10
|
||||||
#
|
asyncclick==7.0.9
|
||||||
aiomysql==0.0.20 # via alice (setup.py)
|
asynctest==0.13.0
|
||||||
aiosqlite==0.13.0 # via alice (setup.py)
|
attrs==19.3.0
|
||||||
anyio==1.3.0 # via alice (setup.py), asyncclick
|
black==19.10b0
|
||||||
async-generator==1.10 # via alice (setup.py), anyio
|
cffi==1.14.0
|
||||||
asyncclick==7.0.9 # via alice (setup.py)
|
ciso8601==2.1.3; sys_platform != "win32" and implementation_name == "cpython"
|
||||||
cffi==1.14.0 # via alice (setup.py), cryptography
|
click==7.1.2
|
||||||
cryptography==2.9.2 # via alice (setup.py), pymysql
|
cryptography==2.9.2
|
||||||
pycparser==2.20 # via alice (setup.py), cffi
|
flake8==3.8.1
|
||||||
pymysql==0.9.2 # via aiomysql, alice (setup.py)
|
iso8601==0.1.12; sys_platform == "win32" or implementation_name != "cpython"
|
||||||
pypika==0.37.6 # via alice (setup.py)
|
isort==4.3.21
|
||||||
six==1.14.0 # via alice (setup.py), cryptography
|
mccabe==0.6.1
|
||||||
sniffio==1.1.0 # via alice (setup.py), anyio
|
pathspec==0.8.0
|
||||||
typing-extensions==3.7.4.2 # via alice (setup.py)
|
pycodestyle==2.6.0
|
||||||
|
pycparser==2.20
|
||||||
|
pyflakes==2.2.0
|
||||||
|
pymysql==0.9.2
|
||||||
|
pypika==0.37.6
|
||||||
|
regex==2020.5.14
|
||||||
|
six==1.14.0
|
||||||
|
sniffio==1.1.0
|
||||||
|
taskipy==1.2.1
|
||||||
|
toml==0.10.1
|
||||||
|
-e git+https://github.com/tortoise/tortoise-orm.git@95c384a4742ee5980f8e4ae934bfdb0d8137bb40#egg=tortoise-orm
|
||||||
|
typed-ast==1.4.1
|
||||||
|
typing-extensions==3.7.4.2
|
||||||
|
10
setup.py
10
setup.py
@ -4,7 +4,7 @@ from setuptools import find_packages, setup
|
|||||||
|
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
ver_str_line = open('alice/__init__.py', 'rt').read()
|
ver_str_line = open('aerich/__init__.py', 'rt').read()
|
||||||
mob = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", ver_str_line, re.M)
|
mob = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", ver_str_line, re.M)
|
||||||
if not mob:
|
if not mob:
|
||||||
raise RuntimeError("Unable to find version string")
|
raise RuntimeError("Unable to find version string")
|
||||||
@ -20,20 +20,20 @@ def requirements():
|
|||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='alice',
|
name='aerich',
|
||||||
version=version(),
|
version=version(),
|
||||||
description='A database migrations tool for Tortoise-ORM.',
|
description='A database migrations tool for Tortoise-ORM.',
|
||||||
author='long2ice',
|
author='long2ice',
|
||||||
long_description_content_type='text/x-rst',
|
long_description_content_type='text/x-rst',
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
author_email='long2ice@gmail.com',
|
author_email='long2ice@gmail.com',
|
||||||
url='https://github.com/long2ice/alice',
|
url='https://github.com/long2ice/aerich',
|
||||||
license='MIT License',
|
license='MIT License',
|
||||||
packages=find_packages(include=['alice*']),
|
packages=find_packages(include=['aerich*']),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=True,
|
zip_safe=True,
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': ['alice = alice.cli:main'],
|
'console_scripts': ['aerich = aerich.cli:main'],
|
||||||
},
|
},
|
||||||
platforms='any',
|
platforms='any',
|
||||||
keywords=(
|
keywords=(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from asynctest import TestCase
|
from asynctest import TestCase
|
||||||
from tortoise import Tortoise
|
from tortoise import Tortoise
|
||||||
|
|
||||||
from alice.ddl.mysql import MysqlDDL
|
from aerich.ddl.mysql import MysqlDDL
|
||||||
|
|
||||||
TORTOISE_ORM = {
|
TORTOISE_ORM = {
|
||||||
"connections": {"default": "mysql://root:123456@127.0.0.1:3306/test",},
|
"connections": {"default": "mysql://root:123456@127.0.0.1:3306/test",},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from asynctest import TestCase
|
from asynctest import TestCase
|
||||||
from tortoise import Tortoise
|
from tortoise import Tortoise
|
||||||
|
|
||||||
from alice.migrate import Migrate
|
from aerich.migrate import Migrate
|
||||||
from tests.backends.mysql import TORTOISE_ORM
|
from tests.backends.mysql import TORTOISE_ORM
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user