channel-app 0.0.157a7__py3-none-any.whl → 0.0.157a9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- channel_app/alembic/README +1 -0
- channel_app/{database/migrations → alembic}/env.py +4 -8
- channel_app/alembic/script.py.mako +28 -0
- channel_app/alembic/versions/6d5ae5b9c541_create_initial_tables.py +68 -0
- channel_app/alembic/versions/__init__.py +0 -0
- channel_app/alembic.ini +119 -0
- channel_app/migrate.py +17 -0
- {channel_app-0.0.157a7.dist-info → channel_app-0.0.157a9.dist-info}/METADATA +6 -1
- {channel_app-0.0.157a7.dist-info → channel_app-0.0.157a9.dist-info}/RECORD +12 -6
- /channel_app/{database/migrations → alembic}/__init__.py +0 -0
- {channel_app-0.0.157a7.dist-info → channel_app-0.0.157a9.dist-info}/WHEEL +0 -0
- {channel_app-0.0.157a7.dist-info → channel_app-0.0.157a9.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
Generic single-database configuration.
|
@@ -1,13 +1,11 @@
|
|
1
|
-
import os
|
2
1
|
from logging.config import fileConfig
|
3
2
|
|
4
3
|
from sqlalchemy import engine_from_config
|
5
4
|
from sqlalchemy import pool
|
6
5
|
|
7
6
|
from alembic import context
|
8
|
-
|
9
|
-
from
|
10
|
-
from channel_app.database.models import Base as BaseModel
|
7
|
+
from core import settings
|
8
|
+
from database.models import Base as BaseModel
|
11
9
|
|
12
10
|
# this is the Alembic Config object, which provides
|
13
11
|
# access to the values within the .ini file in use.
|
@@ -30,7 +28,7 @@ target_metadata = BaseModel.metadata
|
|
30
28
|
# ... etc.
|
31
29
|
|
32
30
|
DATABASE_URL = f"postgresql+psycopg2://{settings.DB_USER}:{settings.DB_PASSWORD}@{settings.DB_HOST}:{settings.DB_PORT}/{settings.DB_NAME}"
|
33
|
-
|
31
|
+
config.set_main_option("sqlalchemy.url", DATABASE_URL)
|
34
32
|
|
35
33
|
|
36
34
|
def run_migrations_offline() -> None:
|
@@ -45,11 +43,9 @@ def run_migrations_offline() -> None:
|
|
45
43
|
script output.
|
46
44
|
|
47
45
|
"""
|
48
|
-
url = config.get_main_option("sqlalchemy.url")
|
49
|
-
|
50
46
|
DATABASE_URL = f"postgresql+psycopg2://{settings.DB_USER}:{settings.DB_PASSWORD}@{settings.DB_HOST}:{settings.DB_PORT}/{settings.DB_NAME}"
|
51
47
|
url = config.set_main_option("sqlalchemy.url", DATABASE_URL)
|
52
|
-
|
48
|
+
|
53
49
|
context.configure(
|
54
50
|
url=url,
|
55
51
|
target_metadata=target_metadata,
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"""${message}
|
2
|
+
|
3
|
+
Revision ID: ${up_revision}
|
4
|
+
Revises: ${down_revision | comma,n}
|
5
|
+
Create Date: ${create_date}
|
6
|
+
|
7
|
+
"""
|
8
|
+
from typing import Sequence, Union
|
9
|
+
|
10
|
+
from alembic import op
|
11
|
+
import sqlalchemy as sa
|
12
|
+
${imports if imports else ""}
|
13
|
+
|
14
|
+
# revision identifiers, used by Alembic.
|
15
|
+
revision: str = ${repr(up_revision)}
|
16
|
+
down_revision: Union[str, None] = ${repr(down_revision)}
|
17
|
+
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
|
18
|
+
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}
|
19
|
+
|
20
|
+
|
21
|
+
def upgrade() -> None:
|
22
|
+
"""Upgrade schema."""
|
23
|
+
${upgrades if upgrades else "pass"}
|
24
|
+
|
25
|
+
|
26
|
+
def downgrade() -> None:
|
27
|
+
"""Downgrade schema."""
|
28
|
+
${downgrades if downgrades else "pass"}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
"""create initial tables
|
2
|
+
|
3
|
+
Revision ID: 6d5ae5b9c541
|
4
|
+
Revises:
|
5
|
+
Create Date: 2025-05-07 19:10:39.137004
|
6
|
+
|
7
|
+
"""
|
8
|
+
from typing import Sequence, Union
|
9
|
+
|
10
|
+
from alembic import op
|
11
|
+
import sqlalchemy as sa
|
12
|
+
|
13
|
+
|
14
|
+
# revision identifiers, used by Alembic.
|
15
|
+
revision: str = '6d5ae5b9c541'
|
16
|
+
down_revision: Union[str, None] = None
|
17
|
+
branch_labels: Union[str, Sequence[str], None] = None
|
18
|
+
depends_on: Union[str, Sequence[str], None] = None
|
19
|
+
|
20
|
+
|
21
|
+
def upgrade() -> None:
|
22
|
+
"""Upgrade schema."""
|
23
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
24
|
+
op.create_table('log_flows',
|
25
|
+
sa.Column('id', sa.UUID(), nullable=False),
|
26
|
+
sa.Column('transaction_id', sa.UUID(), nullable=False),
|
27
|
+
sa.Column('flow_name', sa.String(length=255), nullable=False),
|
28
|
+
sa.Column('flow_author', sa.Enum('user', 'system', name='logflowauthor'), nullable=False),
|
29
|
+
sa.Column('started_at', sa.DateTime(timezone=True), nullable=False),
|
30
|
+
sa.Column('ended_at', sa.DateTime(timezone=True), nullable=True),
|
31
|
+
sa.Column('status', sa.Enum('in_progress', 'success', 'failure', name='logstepstatus'), nullable=True),
|
32
|
+
sa.Column('s3_key', sa.Text(), nullable=True),
|
33
|
+
sa.PrimaryKeyConstraint('id'),
|
34
|
+
sa.UniqueConstraint('transaction_id')
|
35
|
+
)
|
36
|
+
op.create_table('log_steps',
|
37
|
+
sa.Column('id', sa.UUID(), nullable=False),
|
38
|
+
sa.Column('flow_id', sa.UUID(), nullable=False),
|
39
|
+
sa.Column('step_name', sa.String(length=255), nullable=False),
|
40
|
+
sa.Column('status', sa.Enum('in_progress', 'success', 'failure', name='logstepstatus', native_enum=False), nullable=False),
|
41
|
+
sa.Column('start_time', sa.DateTime(timezone=True), nullable=False),
|
42
|
+
sa.Column('end_time', sa.DateTime(timezone=True), nullable=True),
|
43
|
+
sa.Column('duration_ms', sa.Integer(), nullable=True),
|
44
|
+
sa.Column('error_message', sa.String(), nullable=True),
|
45
|
+
sa.Column('step_metadata', sa.JSON(), nullable=True),
|
46
|
+
sa.ForeignKeyConstraint(['flow_id'], ['log_flows.id'], ondelete='CASCADE'),
|
47
|
+
sa.PrimaryKeyConstraint('id')
|
48
|
+
)
|
49
|
+
op.create_table('log_step_exceptions',
|
50
|
+
sa.Column('id', sa.UUID(), nullable=False),
|
51
|
+
sa.Column('step_id', sa.UUID(), nullable=False),
|
52
|
+
sa.Column('type', sa.String(length=128), nullable=False),
|
53
|
+
sa.Column('message', sa.String(), nullable=True),
|
54
|
+
sa.Column('traceback', sa.String(), nullable=True),
|
55
|
+
sa.Column('created_at', sa.DateTime(timezone=True), nullable=False),
|
56
|
+
sa.ForeignKeyConstraint(['step_id'], ['log_steps.id'], ondelete='CASCADE'),
|
57
|
+
sa.PrimaryKeyConstraint('id')
|
58
|
+
)
|
59
|
+
# ### end Alembic commands ###
|
60
|
+
|
61
|
+
|
62
|
+
def downgrade() -> None:
|
63
|
+
"""Downgrade schema."""
|
64
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
65
|
+
op.drop_table('log_step_exceptions')
|
66
|
+
op.drop_table('log_steps')
|
67
|
+
op.drop_table('log_flows')
|
68
|
+
# ### end Alembic commands ###
|
File without changes
|
channel_app/alembic.ini
ADDED
@@ -0,0 +1,119 @@
|
|
1
|
+
# A generic, single database configuration.
|
2
|
+
|
3
|
+
[alembic]
|
4
|
+
# path to migration scripts
|
5
|
+
# Use forward slashes (/) also on windows to provide an os agnostic path
|
6
|
+
script_location = alembic
|
7
|
+
|
8
|
+
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
|
9
|
+
# Uncomment the line below if you want the files to be prepended with date and time
|
10
|
+
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
|
11
|
+
# for all available tokens
|
12
|
+
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
|
13
|
+
|
14
|
+
# sys.path path, will be prepended to sys.path if present.
|
15
|
+
# defaults to the current working directory.
|
16
|
+
prepend_sys_path = .
|
17
|
+
|
18
|
+
# timezone to use when rendering the date within the migration file
|
19
|
+
# as well as the filename.
|
20
|
+
# If specified, requires the python>=3.9 or backports.zoneinfo library and tzdata library.
|
21
|
+
# Any required deps can installed by adding `alembic[tz]` to the pip requirements
|
22
|
+
# string value is passed to ZoneInfo()
|
23
|
+
# leave blank for localtime
|
24
|
+
# timezone =
|
25
|
+
|
26
|
+
# max length of characters to apply to the "slug" field
|
27
|
+
# truncate_slug_length = 40
|
28
|
+
|
29
|
+
# set to 'true' to run the environment during
|
30
|
+
# the 'revision' command, regardless of autogenerate
|
31
|
+
# revision_environment = false
|
32
|
+
|
33
|
+
# set to 'true' to allow .pyc and .pyo files without
|
34
|
+
# a source .py file to be detected as revisions in the
|
35
|
+
# versions/ directory
|
36
|
+
# sourceless = false
|
37
|
+
|
38
|
+
# version location specification; This defaults
|
39
|
+
# to alembic/versions. When using multiple version
|
40
|
+
# directories, initial revisions must be specified with --version-path.
|
41
|
+
# The path separator used here should be the separator specified by "version_path_separator" below.
|
42
|
+
# version_locations = %(here)s/bar:%(here)s/bat:alembic/versions
|
43
|
+
|
44
|
+
# version path separator; As mentioned above, this is the character used to split
|
45
|
+
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
|
46
|
+
# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas.
|
47
|
+
# Valid values for version_path_separator are:
|
48
|
+
#
|
49
|
+
# version_path_separator = :
|
50
|
+
# version_path_separator = ;
|
51
|
+
# version_path_separator = space
|
52
|
+
# version_path_separator = newline
|
53
|
+
#
|
54
|
+
# Use os.pathsep. Default configuration used for new projects.
|
55
|
+
version_path_separator = os
|
56
|
+
|
57
|
+
# set to 'true' to search source files recursively
|
58
|
+
# in each "version_locations" directory
|
59
|
+
# new in Alembic version 1.10
|
60
|
+
# recursive_version_locations = false
|
61
|
+
|
62
|
+
# the output encoding used when revision files
|
63
|
+
# are written from script.py.mako
|
64
|
+
# output_encoding = utf-8
|
65
|
+
|
66
|
+
sqlalchemy.url = driver://user:pass@localhost/dbname
|
67
|
+
|
68
|
+
|
69
|
+
[post_write_hooks]
|
70
|
+
# post_write_hooks defines scripts or Python functions that are run
|
71
|
+
# on newly generated revision scripts. See the documentation for further
|
72
|
+
# detail and examples
|
73
|
+
|
74
|
+
# format using "black" - use the console_scripts runner, against the "black" entrypoint
|
75
|
+
# hooks = black
|
76
|
+
# black.type = console_scripts
|
77
|
+
# black.entrypoint = black
|
78
|
+
# black.options = -l 79 REVISION_SCRIPT_FILENAME
|
79
|
+
|
80
|
+
# lint with attempts to fix using "ruff" - use the exec runner, execute a binary
|
81
|
+
# hooks = ruff
|
82
|
+
# ruff.type = exec
|
83
|
+
# ruff.executable = %(here)s/.venv/bin/ruff
|
84
|
+
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
|
85
|
+
|
86
|
+
# Logging configuration
|
87
|
+
[loggers]
|
88
|
+
keys = root,sqlalchemy,alembic
|
89
|
+
|
90
|
+
[handlers]
|
91
|
+
keys = console
|
92
|
+
|
93
|
+
[formatters]
|
94
|
+
keys = generic
|
95
|
+
|
96
|
+
[logger_root]
|
97
|
+
level = WARNING
|
98
|
+
handlers = console
|
99
|
+
qualname =
|
100
|
+
|
101
|
+
[logger_sqlalchemy]
|
102
|
+
level = WARNING
|
103
|
+
handlers =
|
104
|
+
qualname = sqlalchemy.engine
|
105
|
+
|
106
|
+
[logger_alembic]
|
107
|
+
level = INFO
|
108
|
+
handlers =
|
109
|
+
qualname = alembic
|
110
|
+
|
111
|
+
[handler_console]
|
112
|
+
class = StreamHandler
|
113
|
+
args = (sys.stderr,)
|
114
|
+
level = NOTSET
|
115
|
+
formatter = generic
|
116
|
+
|
117
|
+
[formatter_generic]
|
118
|
+
format = %(levelname)-5.5s [%(name)s] %(message)s
|
119
|
+
datefmt = %H:%M:%S
|
channel_app/migrate.py
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
import os
|
2
|
+
from alembic.config import Config
|
3
|
+
from alembic import command
|
4
|
+
|
5
|
+
def run_alembic_migrations():
|
6
|
+
# Bulunduğun dosyadan göreli yol oluştur
|
7
|
+
base_dir = os.path.dirname(os.path.abspath(__file__))
|
8
|
+
ini_path = os.path.join(base_dir, 'alembic.ini')
|
9
|
+
|
10
|
+
# Alembic yapılandırmasını yükle
|
11
|
+
alembic_cfg = Config(ini_path)
|
12
|
+
|
13
|
+
# Migrasyonları uygula (upgrade to head)
|
14
|
+
command.upgrade(alembic_cfg, "head")
|
15
|
+
|
16
|
+
if __name__ == "__main__":
|
17
|
+
run_alembic_migrations()
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: channel-app
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.157a9
|
4
4
|
Summary: Channel app for Sales Channels
|
5
5
|
Home-page: https://github.com/akinon/channel_app
|
6
6
|
Author: akinonteam
|
@@ -8,4 +8,9 @@ Classifier: Development Status :: 5 - Production/Stable
|
|
8
8
|
Requires-Python: >=3.5
|
9
9
|
Description-Content-Type: text/markdown
|
10
10
|
Requires-Dist: requests
|
11
|
+
Requires-Dist: python-dotenv
|
12
|
+
Requires-Dist: psycopg2-binary
|
13
|
+
Requires-Dist: sqlalchemy
|
14
|
+
Requires-Dist: alembic
|
15
|
+
Requires-Dist: boto3
|
11
16
|
|
@@ -1,4 +1,12 @@
|
|
1
1
|
channel_app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
channel_app/alembic.ini,sha256=XLiRhZWEahYX2iZJI-W4rllrv3CxVsiydr-y-OCESy8,3739
|
3
|
+
channel_app/migrate.py,sha256=Y-e5xgLF2QVvq340eL-G96Vhxi8iYoM0rk-V-ivzrdw,484
|
4
|
+
channel_app/alembic/README,sha256=MVlc9TYmr57RbhXET6QxgyCcwWP7w-vLkEsirENqiIQ,38
|
5
|
+
channel_app/alembic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
channel_app/alembic/env.py,sha256=09gf5T27hOWppm05teOp9FVyGS99_angdikc91sS35E,2546
|
7
|
+
channel_app/alembic/script.py.mako,sha256=3qBrHBf7F7ChKDUIdiNItiSXrDpgQdM7sR0YKzpaC50,689
|
8
|
+
channel_app/alembic/versions/6d5ae5b9c541_create_initial_tables.py,sha256=EtCzz93LZcBYd7cbIe0w5eYPINduo_Duz4tdetTvTo4,2785
|
9
|
+
channel_app/alembic/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
10
|
channel_app/app/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
11
|
channel_app/app/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
12
|
channel_app/app/order/service.py,sha256=GZ8StGwvICtI0DWMtYFq1mB9GPdojNpjCh9oVrHlHJE,22366
|
@@ -35,8 +43,6 @@ channel_app/core/utilities.py,sha256=3iSU4RHFSsdTWBfUYBK23CRGtAIC-nYIBIJLm0Dlx3o
|
|
35
43
|
channel_app/database/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
44
|
channel_app/database/models.py,sha256=cdjLcfJe-OYZzk1fl3JL6ght8jryRYLwMF2uV3srM-o,2314
|
37
45
|
channel_app/database/services.py,sha256=VkF38jtV_E3Am7459mN5ofvkF1N06gnTWbRdmMzNjYw,354
|
38
|
-
channel_app/database/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
39
|
-
channel_app/database/migrations/env.py,sha256=f-AgY2RNfp4nzARjDwBVJE0Yn2L6SSmtx9smvqInPqk,2639
|
40
46
|
channel_app/logs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
41
47
|
channel_app/logs/encoders.py,sha256=6CVgtkV7DrjxGpNXCJgT9bn9B2Ep0lHgtm-0ES7A57I,703
|
42
48
|
channel_app/logs/enums.py,sha256=If6ZjwRTerbJypYI8WjdsleHR7FjlV-TP2nBppFVEc4,214
|
@@ -67,7 +73,7 @@ channel_app/omnitron/commands/tests/test_product_images.py,sha256=y6tmiJ00kd2GTq
|
|
67
73
|
channel_app/omnitron/commands/tests/test_product_prices.py,sha256=5HPX9PmjGw6gk3oNrwtWLqdrOkfeNx1mYP-pYwOesZU,3496
|
68
74
|
channel_app/omnitron/commands/tests/test_product_stocks.py,sha256=q4RGlrCNUUJyN5CBL1fzrvdd4Q3xt816mbMRQT0XEd0,3496
|
69
75
|
channel_app/omnitron/commands/tests/test_products.py,sha256=uj5KLaubY3XNu0hidOH-u-Djfboe81Hj7-lP--01Le0,103494
|
70
|
-
channel_app-0.0.
|
71
|
-
channel_app-0.0.
|
72
|
-
channel_app-0.0.
|
73
|
-
channel_app-0.0.
|
76
|
+
channel_app-0.0.157a9.dist-info/METADATA,sha256=1j1ByvDdfT90JdhrJqHa2DZY-TbAvxGRbI-7m7pxZ8Q,441
|
77
|
+
channel_app-0.0.157a9.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
78
|
+
channel_app-0.0.157a9.dist-info/top_level.txt,sha256=JT-gM6L5Cwxr1xEoN7NHrREDs-d6iGFGfRnK-NrJ3tU,12
|
79
|
+
channel_app-0.0.157a9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|