mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix: 修复迁移helper
This commit is contained in:
@@ -14,6 +14,8 @@ from alembic import context
|
|||||||
|
|
||||||
# 添加项目根目录到 Python 路径
|
# 添加项目根目录到 Python 路径
|
||||||
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
|
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
|
||||||
|
# 添加 alembic 目录,让迁移文件可以 `from helpers import ...`
|
||||||
|
sys.path.insert(0, os.path.dirname(__file__))
|
||||||
|
|
||||||
# 加载 .env 文件(本地开发时需要)
|
# 加载 .env 文件(本地开发时需要)
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Create Date: 2026-03-08 03:48:49.622091+00:00
|
|||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from alembic.helpers import new_cache, replace_fk_if_needed
|
from helpers import new_cache, replace_fk_if_needed
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = "45b118150a78"
|
revision = "45b118150a78"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Create Date: 2026-03-08 12:15:00.000000+00:00
|
|||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from alembic.helpers import new_cache, replace_fk_if_needed
|
from helpers import new_cache, replace_fk_if_needed
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = "13a4c8f6d9e0"
|
revision = "13a4c8f6d9e0"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ Create Date: 2026-03-08 15:30:00.000000+00:00
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic import op
|
from alembic import op
|
||||||
from alembic.helpers import batch_alter_type, index_exists, new_cache
|
from helpers import batch_alter_type, index_exists, new_cache
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = "2053ab8ed764"
|
revision = "2053ab8ed764"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ Create Date: 2026-03-09 01:00:00.000000+00:00
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from alembic.helpers import new_cache, replace_fk_if_needed
|
from helpers import new_cache, replace_fk_if_needed
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = "d7649c1f8e21"
|
revision = "d7649c1f8e21"
|
||||||
|
|||||||
Reference in New Issue
Block a user