esgpull 0.6.3__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.
- esgpull/__init__.py +12 -0
- esgpull/auth.py +181 -0
- esgpull/cli/__init__.py +73 -0
- esgpull/cli/add.py +103 -0
- esgpull/cli/autoremove.py +38 -0
- esgpull/cli/config.py +116 -0
- esgpull/cli/convert.py +285 -0
- esgpull/cli/decorators.py +342 -0
- esgpull/cli/download.py +74 -0
- esgpull/cli/facet.py +23 -0
- esgpull/cli/get.py +28 -0
- esgpull/cli/install.py +85 -0
- esgpull/cli/link.py +105 -0
- esgpull/cli/login.py +56 -0
- esgpull/cli/remove.py +73 -0
- esgpull/cli/retry.py +43 -0
- esgpull/cli/search.py +201 -0
- esgpull/cli/self.py +238 -0
- esgpull/cli/show.py +66 -0
- esgpull/cli/status.py +67 -0
- esgpull/cli/track.py +87 -0
- esgpull/cli/update.py +184 -0
- esgpull/cli/utils.py +247 -0
- esgpull/config.py +410 -0
- esgpull/constants.py +56 -0
- esgpull/context.py +724 -0
- esgpull/database.py +161 -0
- esgpull/download.py +162 -0
- esgpull/esgpull.py +447 -0
- esgpull/exceptions.py +167 -0
- esgpull/fs.py +253 -0
- esgpull/graph.py +460 -0
- esgpull/install_config.py +185 -0
- esgpull/migrations/README +1 -0
- esgpull/migrations/env.py +82 -0
- esgpull/migrations/script.py.mako +24 -0
- esgpull/migrations/versions/0.3.0_update_tables.py +170 -0
- esgpull/migrations/versions/0.3.1_update_tables.py +25 -0
- esgpull/migrations/versions/0.3.2_update_tables.py +26 -0
- esgpull/migrations/versions/0.3.3_update_tables.py +25 -0
- esgpull/migrations/versions/0.3.4_update_tables.py +25 -0
- esgpull/migrations/versions/0.3.5_update_tables.py +25 -0
- esgpull/migrations/versions/0.3.6_update_tables.py +26 -0
- esgpull/migrations/versions/0.3.7_update_tables.py +26 -0
- esgpull/migrations/versions/0.3.8_update_tables.py +26 -0
- esgpull/migrations/versions/0.4.0_update_tables.py +25 -0
- esgpull/migrations/versions/0.5.0_update_tables.py +26 -0
- esgpull/migrations/versions/0.5.1_update_tables.py +26 -0
- esgpull/migrations/versions/0.5.2_update_tables.py +25 -0
- esgpull/migrations/versions/0.5.3_update_tables.py +26 -0
- esgpull/migrations/versions/0.5.4_update_tables.py +25 -0
- esgpull/migrations/versions/0.5.5_update_tables.py +25 -0
- esgpull/migrations/versions/0.6.0_update_tables.py +25 -0
- esgpull/migrations/versions/0.6.1_update_tables.py +25 -0
- esgpull/migrations/versions/0.6.2_update_tables.py +25 -0
- esgpull/migrations/versions/0.6.3_update_tables.py +25 -0
- esgpull/models/__init__.py +31 -0
- esgpull/models/base.py +50 -0
- esgpull/models/dataset.py +34 -0
- esgpull/models/facet.py +18 -0
- esgpull/models/file.py +65 -0
- esgpull/models/options.py +164 -0
- esgpull/models/query.py +481 -0
- esgpull/models/selection.py +201 -0
- esgpull/models/sql.py +258 -0
- esgpull/models/synda_file.py +85 -0
- esgpull/models/tag.py +19 -0
- esgpull/models/utils.py +54 -0
- esgpull/presets.py +13 -0
- esgpull/processor.py +172 -0
- esgpull/py.typed +0 -0
- esgpull/result.py +53 -0
- esgpull/tui.py +346 -0
- esgpull/utils.py +54 -0
- esgpull/version.py +1 -0
- esgpull-0.6.3.dist-info/METADATA +110 -0
- esgpull-0.6.3.dist-info/RECORD +80 -0
- esgpull-0.6.3.dist-info/WHEEL +4 -0
- esgpull-0.6.3.dist-info/entry_points.txt +3 -0
- esgpull-0.6.3.dist-info/licenses/LICENSE +28 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
import platformdirs
|
|
9
|
+
from typing_extensions import NotRequired, TypedDict
|
|
10
|
+
|
|
11
|
+
from esgpull.constants import ROOT_ENV
|
|
12
|
+
from esgpull.exceptions import AlreadyInstalledName, AlreadyInstalledPath
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass(init=False)
|
|
16
|
+
class Install:
|
|
17
|
+
path: Path
|
|
18
|
+
name: str | None = None
|
|
19
|
+
|
|
20
|
+
def __init__(self, path: Path | str, name: str | None = None) -> None:
|
|
21
|
+
self.path = Path(path)
|
|
22
|
+
self.name = name
|
|
23
|
+
|
|
24
|
+
def asdict(self) -> InstallDict:
|
|
25
|
+
result: InstallDict = {"path": str(self.path)}
|
|
26
|
+
if self.name is not None:
|
|
27
|
+
result["name"] = self.name
|
|
28
|
+
return result
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class InstallDict(TypedDict):
|
|
32
|
+
path: str
|
|
33
|
+
name: NotRequired[str]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class InstallConfigDict(TypedDict):
|
|
37
|
+
current: NotRequired[int]
|
|
38
|
+
installs: list[InstallDict]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@dataclass(init=False)
|
|
42
|
+
class _InstallConfig:
|
|
43
|
+
path: Path
|
|
44
|
+
current_idx: int | None
|
|
45
|
+
installs: list[Install]
|
|
46
|
+
|
|
47
|
+
def __init__(self) -> None:
|
|
48
|
+
user_config_dir = platformdirs.user_config_path("esgpull")
|
|
49
|
+
self.path = user_config_dir / "installs.json"
|
|
50
|
+
if self.path.is_file():
|
|
51
|
+
with self.path.open() as f:
|
|
52
|
+
content = json.load(f)
|
|
53
|
+
self.current_idx = content.get("current")
|
|
54
|
+
installs = content.get("installs", [])
|
|
55
|
+
self.installs = [Install(**inst) for inst in installs]
|
|
56
|
+
else:
|
|
57
|
+
self.current_idx = None
|
|
58
|
+
self.installs = []
|
|
59
|
+
|
|
60
|
+
def fullpath(self, path: Path) -> Path:
|
|
61
|
+
return path.expanduser().resolve()
|
|
62
|
+
|
|
63
|
+
@property
|
|
64
|
+
def current(self) -> Install | None:
|
|
65
|
+
env = os.getenv(ROOT_ENV)
|
|
66
|
+
if env is not None:
|
|
67
|
+
return self.installs[int(env)]
|
|
68
|
+
elif self.current_idx is not None:
|
|
69
|
+
return self.installs[self.current_idx]
|
|
70
|
+
else:
|
|
71
|
+
return None
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def default(self) -> Path:
|
|
75
|
+
return Path.home() / ".esgpull"
|
|
76
|
+
|
|
77
|
+
def activate_msg(self, idx: int, commented: bool = False) -> str:
|
|
78
|
+
install = self.installs[idx]
|
|
79
|
+
name = install.name or install.path
|
|
80
|
+
msg = f"""
|
|
81
|
+
To choose {install.path} as the current install location:
|
|
82
|
+
|
|
83
|
+
$ esgpull self choose {name}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
To enable {install.path} for the current shell:
|
|
87
|
+
|
|
88
|
+
$ eval $(esgpull self activate {name})
|
|
89
|
+
""".strip()
|
|
90
|
+
if commented:
|
|
91
|
+
lines = msg.splitlines()
|
|
92
|
+
return "\n".join("# " + line for line in lines)
|
|
93
|
+
else:
|
|
94
|
+
return msg
|
|
95
|
+
|
|
96
|
+
def activate_needs_eval(self, idx: int) -> str:
|
|
97
|
+
export = f"export {ROOT_ENV}={idx}"
|
|
98
|
+
comment = self.activate_msg(idx, commented=True)
|
|
99
|
+
return "\n".join([export, comment])
|
|
100
|
+
|
|
101
|
+
def asdict(self) -> InstallConfigDict:
|
|
102
|
+
result: InstallConfigDict = {
|
|
103
|
+
"installs": [inst.asdict() for inst in self.installs]
|
|
104
|
+
}
|
|
105
|
+
if self.current_idx is not None:
|
|
106
|
+
result["current"] = self.current_idx
|
|
107
|
+
return result
|
|
108
|
+
|
|
109
|
+
def add(self, path: Path, name: str | None = None) -> int:
|
|
110
|
+
install = Install(self.fullpath(path), name)
|
|
111
|
+
idx_path = self.index(path=install.path)
|
|
112
|
+
if idx_path > -1:
|
|
113
|
+
raise AlreadyInstalledPath(
|
|
114
|
+
path=install.path,
|
|
115
|
+
msg=self.activate_msg(idx_path),
|
|
116
|
+
)
|
|
117
|
+
if name is not None:
|
|
118
|
+
idx_name = self.index(name=name)
|
|
119
|
+
if idx_name > -1:
|
|
120
|
+
raise AlreadyInstalledName(
|
|
121
|
+
name=name,
|
|
122
|
+
msg=self.activate_msg(idx_name),
|
|
123
|
+
)
|
|
124
|
+
self.installs.append(install)
|
|
125
|
+
return len(self.installs) - 1
|
|
126
|
+
|
|
127
|
+
def remove_current(self) -> bool:
|
|
128
|
+
if self.current_idx is None:
|
|
129
|
+
return False
|
|
130
|
+
else:
|
|
131
|
+
self.installs.pop(self.current_idx)
|
|
132
|
+
self.current_idx = None
|
|
133
|
+
return True
|
|
134
|
+
|
|
135
|
+
def choose(
|
|
136
|
+
self,
|
|
137
|
+
*,
|
|
138
|
+
idx: int | None = None,
|
|
139
|
+
name: str | None = None,
|
|
140
|
+
path: Path | None = None,
|
|
141
|
+
) -> None:
|
|
142
|
+
if idx is not None:
|
|
143
|
+
self.current_idx = idx
|
|
144
|
+
elif name is not None:
|
|
145
|
+
self.current_idx = self.index(name=name)
|
|
146
|
+
elif path is not None:
|
|
147
|
+
self.current_idx = self.index(path=path)
|
|
148
|
+
else:
|
|
149
|
+
self.current_idx = None
|
|
150
|
+
if self.current_idx == -1:
|
|
151
|
+
self.current_idx = None
|
|
152
|
+
|
|
153
|
+
def write(self) -> None:
|
|
154
|
+
self.path.parent.mkdir(parents=True, exist_ok=True)
|
|
155
|
+
with self.path.open("w") as f:
|
|
156
|
+
json.dump(self.asdict(), f)
|
|
157
|
+
|
|
158
|
+
def index(
|
|
159
|
+
self,
|
|
160
|
+
*,
|
|
161
|
+
name: str | None = None,
|
|
162
|
+
path: Path | None = None,
|
|
163
|
+
) -> int:
|
|
164
|
+
if name is not None:
|
|
165
|
+
return self._index_name(name)
|
|
166
|
+
elif path is not None:
|
|
167
|
+
return self._index_path(path)
|
|
168
|
+
else:
|
|
169
|
+
raise ValueError("nothing provided")
|
|
170
|
+
|
|
171
|
+
def _index_name(self, name: str) -> int:
|
|
172
|
+
for i, inst in enumerate(self.installs):
|
|
173
|
+
if inst.name is not None and name == inst.name:
|
|
174
|
+
return i
|
|
175
|
+
return -1
|
|
176
|
+
|
|
177
|
+
def _index_path(self, path: Path) -> int:
|
|
178
|
+
path = self.fullpath(path)
|
|
179
|
+
for i, inst in enumerate(self.installs):
|
|
180
|
+
if path == inst.path:
|
|
181
|
+
return i
|
|
182
|
+
return -1
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
InstallConfig = _InstallConfig()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Generic single-database configuration.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from logging.config import fileConfig
|
|
2
|
+
|
|
3
|
+
from alembic import context
|
|
4
|
+
|
|
5
|
+
from esgpull.config import Config
|
|
6
|
+
from esgpull.database import Database
|
|
7
|
+
from esgpull.models import Base
|
|
8
|
+
|
|
9
|
+
# from sqlalchemy import engine_from_config, pool
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# this is the Alembic Config object, which provides
|
|
13
|
+
# access to the values within the .ini file in use.
|
|
14
|
+
config = context.config
|
|
15
|
+
|
|
16
|
+
# Interpret the config file for Python logging.
|
|
17
|
+
# This line sets up loggers basically.
|
|
18
|
+
if config.config_file_name is not None:
|
|
19
|
+
fileConfig(config.config_file_name)
|
|
20
|
+
|
|
21
|
+
target_metadata = Base.metadata
|
|
22
|
+
|
|
23
|
+
# other values from the config, defined by the needs of env.py,
|
|
24
|
+
# can be acquired:
|
|
25
|
+
# my_important_option = config.get_main_option("my_important_option")
|
|
26
|
+
# ... etc.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def run_migrations_offline() -> None:
|
|
30
|
+
"""Run migrations in 'offline' mode.
|
|
31
|
+
|
|
32
|
+
This configures the context with just a URL
|
|
33
|
+
and not an Engine, though an Engine is acceptable
|
|
34
|
+
here as well. By skipping the Engine creation
|
|
35
|
+
we don't even need a DBAPI to be available.
|
|
36
|
+
|
|
37
|
+
Calls to context.execute() here emit the given string to the
|
|
38
|
+
script output.
|
|
39
|
+
|
|
40
|
+
"""
|
|
41
|
+
url = config.get_main_option("sqlalchemy.url")
|
|
42
|
+
context.configure(
|
|
43
|
+
url=url,
|
|
44
|
+
target_metadata=target_metadata,
|
|
45
|
+
literal_binds=True,
|
|
46
|
+
dialect_opts={"paramstyle": "named"},
|
|
47
|
+
version_table="version",
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
with context.begin_transaction():
|
|
51
|
+
context.run_migrations()
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def run_migrations_online() -> None:
|
|
55
|
+
"""Run migrations in 'online' mode.
|
|
56
|
+
|
|
57
|
+
In this scenario we need to create an Engine
|
|
58
|
+
and associate a connection with the context.
|
|
59
|
+
|
|
60
|
+
"""
|
|
61
|
+
connectable = config.attributes.get("connection", None)
|
|
62
|
+
|
|
63
|
+
if connectable is None:
|
|
64
|
+
_config = Config()
|
|
65
|
+
db = Database.from_config(_config, run_migrations=False)
|
|
66
|
+
connectable = db._engine
|
|
67
|
+
|
|
68
|
+
with connectable.connect() as connection:
|
|
69
|
+
context.configure(
|
|
70
|
+
connection=connection,
|
|
71
|
+
target_metadata=target_metadata,
|
|
72
|
+
version_table="version",
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
with context.begin_transaction():
|
|
76
|
+
context.run_migrations()
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
if context.is_offline_mode():
|
|
80
|
+
run_migrations_offline()
|
|
81
|
+
else:
|
|
82
|
+
run_migrations_online()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"""${message}
|
|
2
|
+
|
|
3
|
+
Revision ID: ${up_revision}
|
|
4
|
+
Revises: ${down_revision | comma,n}
|
|
5
|
+
Create Date: ${create_date}
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
from alembic import op
|
|
9
|
+
import sqlalchemy as sa
|
|
10
|
+
${imports if imports else ""}
|
|
11
|
+
|
|
12
|
+
# revision identifiers, used by Alembic.
|
|
13
|
+
revision = ${repr(up_revision)}
|
|
14
|
+
down_revision = ${repr(down_revision)}
|
|
15
|
+
branch_labels = ${repr(branch_labels)}
|
|
16
|
+
depends_on = ${repr(depends_on)}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def upgrade() -> None:
|
|
20
|
+
${upgrades if upgrades else "pass"}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def downgrade() -> None:
|
|
24
|
+
${downgrades if downgrades else "pass"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.0
|
|
4
|
+
Revises:
|
|
5
|
+
Create Date: 2023-02-08 14:35:52.386481
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
import sqlalchemy as sa
|
|
9
|
+
from alembic import op
|
|
10
|
+
|
|
11
|
+
# revision identifiers, used by Alembic.
|
|
12
|
+
revision = "0.3.0"
|
|
13
|
+
down_revision = None
|
|
14
|
+
branch_labels = None
|
|
15
|
+
depends_on = None
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def upgrade() -> None:
|
|
19
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
20
|
+
op.create_table(
|
|
21
|
+
"facet",
|
|
22
|
+
sa.Column("name", sa.String(length=64), nullable=False),
|
|
23
|
+
sa.Column("value", sa.String(length=255), nullable=False),
|
|
24
|
+
sa.Column("sha", sa.String(length=40), nullable=False),
|
|
25
|
+
sa.PrimaryKeyConstraint("sha"),
|
|
26
|
+
)
|
|
27
|
+
op.create_table(
|
|
28
|
+
"file",
|
|
29
|
+
sa.Column("file_id", sa.String(length=255), nullable=False),
|
|
30
|
+
sa.Column("dataset_id", sa.String(length=255), nullable=False),
|
|
31
|
+
sa.Column("master_id", sa.String(length=255), nullable=False),
|
|
32
|
+
sa.Column("url", sa.String(length=255), nullable=False),
|
|
33
|
+
sa.Column("version", sa.String(length=16), nullable=False),
|
|
34
|
+
sa.Column("filename", sa.String(length=255), nullable=False),
|
|
35
|
+
sa.Column("local_path", sa.String(length=255), nullable=False),
|
|
36
|
+
sa.Column("data_node", sa.String(length=40), nullable=False),
|
|
37
|
+
sa.Column("checksum", sa.String(length=64), nullable=False),
|
|
38
|
+
sa.Column("checksum_type", sa.String(length=16), nullable=False),
|
|
39
|
+
sa.Column("size", sa.Integer(), nullable=False),
|
|
40
|
+
sa.Column(
|
|
41
|
+
"status",
|
|
42
|
+
sa.Enum(
|
|
43
|
+
"New",
|
|
44
|
+
"Queued",
|
|
45
|
+
"Starting",
|
|
46
|
+
"Started",
|
|
47
|
+
"Pausing",
|
|
48
|
+
"Paused",
|
|
49
|
+
"Error",
|
|
50
|
+
"Cancelled",
|
|
51
|
+
"Done",
|
|
52
|
+
name="filestatus",
|
|
53
|
+
),
|
|
54
|
+
nullable=False,
|
|
55
|
+
),
|
|
56
|
+
sa.Column("sha", sa.String(length=40), nullable=False),
|
|
57
|
+
sa.PrimaryKeyConstraint("sha"),
|
|
58
|
+
sa.UniqueConstraint("file_id"),
|
|
59
|
+
)
|
|
60
|
+
op.create_table(
|
|
61
|
+
"options",
|
|
62
|
+
sa.Column(
|
|
63
|
+
"distrib",
|
|
64
|
+
sa.Enum("false", "true", "none", "notset", name="option"),
|
|
65
|
+
nullable=False,
|
|
66
|
+
),
|
|
67
|
+
sa.Column(
|
|
68
|
+
"latest",
|
|
69
|
+
sa.Enum("false", "true", "none", "notset", name="option"),
|
|
70
|
+
nullable=False,
|
|
71
|
+
),
|
|
72
|
+
sa.Column(
|
|
73
|
+
"replica",
|
|
74
|
+
sa.Enum("false", "true", "none", "notset", name="option"),
|
|
75
|
+
nullable=False,
|
|
76
|
+
),
|
|
77
|
+
sa.Column(
|
|
78
|
+
"retracted",
|
|
79
|
+
sa.Enum("false", "true", "none", "notset", name="option"),
|
|
80
|
+
nullable=False,
|
|
81
|
+
),
|
|
82
|
+
sa.Column("sha", sa.String(length=40), nullable=False),
|
|
83
|
+
sa.PrimaryKeyConstraint("sha"),
|
|
84
|
+
)
|
|
85
|
+
op.create_table(
|
|
86
|
+
"selection",
|
|
87
|
+
sa.Column("sha", sa.String(length=40), nullable=False),
|
|
88
|
+
sa.PrimaryKeyConstraint("sha"),
|
|
89
|
+
)
|
|
90
|
+
op.create_table(
|
|
91
|
+
"tag",
|
|
92
|
+
sa.Column("name", sa.String(length=255), nullable=False),
|
|
93
|
+
sa.Column("description", sa.Text(), nullable=True),
|
|
94
|
+
sa.Column("sha", sa.String(length=40), nullable=False),
|
|
95
|
+
sa.PrimaryKeyConstraint("sha"),
|
|
96
|
+
)
|
|
97
|
+
op.create_table(
|
|
98
|
+
"query",
|
|
99
|
+
sa.Column("tracked", sa.Boolean(), nullable=False),
|
|
100
|
+
sa.Column("require", sa.String(length=40), nullable=True),
|
|
101
|
+
sa.Column("options_sha", sa.String(length=40), nullable=False),
|
|
102
|
+
sa.Column("selection_sha", sa.String(length=40), nullable=False),
|
|
103
|
+
sa.Column("sha", sa.String(length=40), nullable=False),
|
|
104
|
+
sa.ForeignKeyConstraint(
|
|
105
|
+
["options_sha"],
|
|
106
|
+
["options.sha"],
|
|
107
|
+
),
|
|
108
|
+
sa.ForeignKeyConstraint(
|
|
109
|
+
["selection_sha"],
|
|
110
|
+
["selection.sha"],
|
|
111
|
+
),
|
|
112
|
+
sa.PrimaryKeyConstraint("sha"),
|
|
113
|
+
)
|
|
114
|
+
op.create_table(
|
|
115
|
+
"selection_facet",
|
|
116
|
+
sa.Column("selection_sha", sa.String(length=40), nullable=False),
|
|
117
|
+
sa.Column("facet_sha", sa.String(length=40), nullable=False),
|
|
118
|
+
sa.ForeignKeyConstraint(
|
|
119
|
+
["facet_sha"],
|
|
120
|
+
["facet.sha"],
|
|
121
|
+
),
|
|
122
|
+
sa.ForeignKeyConstraint(
|
|
123
|
+
["selection_sha"],
|
|
124
|
+
["selection.sha"],
|
|
125
|
+
),
|
|
126
|
+
sa.PrimaryKeyConstraint("selection_sha", "facet_sha"),
|
|
127
|
+
)
|
|
128
|
+
op.create_table(
|
|
129
|
+
"query_file",
|
|
130
|
+
sa.Column("query_sha", sa.String(length=40), nullable=False),
|
|
131
|
+
sa.Column("file_sha", sa.String(length=40), nullable=False),
|
|
132
|
+
sa.ForeignKeyConstraint(
|
|
133
|
+
["file_sha"],
|
|
134
|
+
["file.sha"],
|
|
135
|
+
),
|
|
136
|
+
sa.ForeignKeyConstraint(
|
|
137
|
+
["query_sha"],
|
|
138
|
+
["query.sha"],
|
|
139
|
+
),
|
|
140
|
+
sa.PrimaryKeyConstraint("query_sha", "file_sha"),
|
|
141
|
+
)
|
|
142
|
+
op.create_table(
|
|
143
|
+
"query_tag",
|
|
144
|
+
sa.Column("query_sha", sa.String(length=40), nullable=False),
|
|
145
|
+
sa.Column("tag_sha", sa.String(length=40), nullable=False),
|
|
146
|
+
sa.ForeignKeyConstraint(
|
|
147
|
+
["query_sha"],
|
|
148
|
+
["query.sha"],
|
|
149
|
+
),
|
|
150
|
+
sa.ForeignKeyConstraint(
|
|
151
|
+
["tag_sha"],
|
|
152
|
+
["tag.sha"],
|
|
153
|
+
),
|
|
154
|
+
sa.PrimaryKeyConstraint("query_sha", "tag_sha"),
|
|
155
|
+
)
|
|
156
|
+
# ### end Alembic commands ###
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def downgrade() -> None:
|
|
160
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
161
|
+
op.drop_table("query_tag")
|
|
162
|
+
op.drop_table("query_file")
|
|
163
|
+
op.drop_table("selection_facet")
|
|
164
|
+
op.drop_table("query")
|
|
165
|
+
op.drop_table("tag")
|
|
166
|
+
op.drop_table("selection")
|
|
167
|
+
op.drop_table("options")
|
|
168
|
+
op.drop_table("file")
|
|
169
|
+
op.drop_table("facet")
|
|
170
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.1
|
|
4
|
+
Revises: 0.3.0
|
|
5
|
+
Create Date: 2023-03-14 11:06:43.639042
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
# revision identifiers, used by Alembic.
|
|
10
|
+
revision = "0.3.1"
|
|
11
|
+
down_revision = "0.3.0"
|
|
12
|
+
branch_labels = None
|
|
13
|
+
depends_on = None
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def upgrade() -> None:
|
|
17
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
18
|
+
pass
|
|
19
|
+
# ### end Alembic commands ###
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def downgrade() -> None:
|
|
23
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
24
|
+
pass
|
|
25
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.2
|
|
4
|
+
Revises: 0.3.1
|
|
5
|
+
Create Date: 2023-03-14 11:27:55.617982
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# revision identifiers, used by Alembic.
|
|
11
|
+
revision = "0.3.2"
|
|
12
|
+
down_revision = "0.3.1"
|
|
13
|
+
branch_labels = None
|
|
14
|
+
depends_on = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def upgrade() -> None:
|
|
18
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
19
|
+
pass
|
|
20
|
+
# ### end Alembic commands ###
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def downgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
pass
|
|
26
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.3
|
|
4
|
+
Revises: 0.3.2
|
|
5
|
+
Create Date: 2023-03-14 12:01:05.975209
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
# revision identifiers, used by Alembic.
|
|
10
|
+
revision = "0.3.3"
|
|
11
|
+
down_revision = "0.3.2"
|
|
12
|
+
branch_labels = None
|
|
13
|
+
depends_on = None
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def upgrade() -> None:
|
|
17
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
18
|
+
pass
|
|
19
|
+
# ### end Alembic commands ###
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def downgrade() -> None:
|
|
23
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
24
|
+
pass
|
|
25
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.4
|
|
4
|
+
Revises: 0.3.3
|
|
5
|
+
Create Date: 2023-03-14 12:09:29.232008
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
# revision identifiers, used by Alembic.
|
|
10
|
+
revision = "0.3.4"
|
|
11
|
+
down_revision = "0.3.3"
|
|
12
|
+
branch_labels = None
|
|
13
|
+
depends_on = None
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def upgrade() -> None:
|
|
17
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
18
|
+
pass
|
|
19
|
+
# ### end Alembic commands ###
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def downgrade() -> None:
|
|
23
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
24
|
+
pass
|
|
25
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.5
|
|
4
|
+
Revises: 0.3.4
|
|
5
|
+
Create Date: 2023-03-16 09:38:48.791464
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
# revision identifiers, used by Alembic.
|
|
10
|
+
revision = "0.3.5"
|
|
11
|
+
down_revision = "0.3.4"
|
|
12
|
+
branch_labels = None
|
|
13
|
+
depends_on = None
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def upgrade() -> None:
|
|
17
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
18
|
+
pass
|
|
19
|
+
# ### end Alembic commands ###
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def downgrade() -> None:
|
|
23
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
24
|
+
pass
|
|
25
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.6
|
|
4
|
+
Revises: 0.3.5
|
|
5
|
+
Create Date: 2023-03-20 16:50:37.655296
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# revision identifiers, used by Alembic.
|
|
11
|
+
revision = "0.3.6"
|
|
12
|
+
down_revision = "0.3.5"
|
|
13
|
+
branch_labels = None
|
|
14
|
+
depends_on = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def upgrade() -> None:
|
|
18
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
19
|
+
pass
|
|
20
|
+
# ### end Alembic commands ###
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def downgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
pass
|
|
26
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.7
|
|
4
|
+
Revises: 0.3.6
|
|
5
|
+
Create Date: 2023-04-03 11:42:09.069300
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# revision identifiers, used by Alembic.
|
|
11
|
+
revision = "0.3.7"
|
|
12
|
+
down_revision = "0.3.6"
|
|
13
|
+
branch_labels = None
|
|
14
|
+
depends_on = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def upgrade() -> None:
|
|
18
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
19
|
+
pass
|
|
20
|
+
# ### end Alembic commands ###
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def downgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
pass
|
|
26
|
+
# ### end Alembic commands ###
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""update tables
|
|
2
|
+
|
|
3
|
+
Revision ID: 0.3.8
|
|
4
|
+
Revises: 0.3.7
|
|
5
|
+
Create Date: 2023-04-13 11:39:58.664284
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# revision identifiers, used by Alembic.
|
|
11
|
+
revision = "0.3.8"
|
|
12
|
+
down_revision = "0.3.7"
|
|
13
|
+
branch_labels = None
|
|
14
|
+
depends_on = None
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def upgrade() -> None:
|
|
18
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
19
|
+
pass
|
|
20
|
+
# ### end Alembic commands ###
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def downgrade() -> None:
|
|
24
|
+
# ### commands auto generated by Alembic - please adjust! ###
|
|
25
|
+
pass
|
|
26
|
+
# ### end Alembic commands ###
|