Add new fields to config and cleardata
This commit is contained in:
5
db.py
5
db.py
@@ -70,6 +70,8 @@ class Profile(Base):
|
|||||||
id: Mapped[int] = mapped_column(primary_key=True)
|
id: Mapped[int] = mapped_column(primary_key=True)
|
||||||
user_id: Mapped[int] = mapped_column(ForeignKey('users.id'))
|
user_id: Mapped[int] = mapped_column(ForeignKey('users.id'))
|
||||||
scheme: Mapped[str]
|
scheme: Mapped[str]
|
||||||
|
branch: Mapped[str]
|
||||||
|
upstream: Mapped[bool]
|
||||||
json: Mapped[str]
|
json: Mapped[str]
|
||||||
|
|
||||||
user: Mapped['User'] = relationship(back_populates='profiles')
|
user: Mapped['User'] = relationship(back_populates='profiles')
|
||||||
@@ -77,6 +79,9 @@ class Profile(Base):
|
|||||||
def to_dict(self) -> dict:
|
def to_dict(self) -> dict:
|
||||||
return {
|
return {
|
||||||
'id': self.id,
|
'id': self.id,
|
||||||
|
'scheme': self.scheme,
|
||||||
|
'branch': self.branch,
|
||||||
|
'upstream': self.upstream,
|
||||||
'json': self.json,
|
'json': self.json,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -539,6 +539,7 @@ def put_object(params, files, url):
|
|||||||
ws.transaction()
|
ws.transaction()
|
||||||
res = ws.save()
|
res = ws.save()
|
||||||
ws.commit(f'Putobject from {params["to"]}')
|
ws.commit(f'Putobject from {params["to"]}')
|
||||||
|
ws.clearData(True)
|
||||||
|
|
||||||
|
|
||||||
def apply_commits(params, files, url):
|
def apply_commits(params, files, url):
|
||||||
@@ -569,6 +570,7 @@ def apply_commits(params, files, url):
|
|||||||
files_data = json.load(f)
|
files_data = json.load(f)
|
||||||
for file_data in files_data:
|
for file_data in files_data:
|
||||||
upload_file(os.path.join(dir.name, file_data['key']), file_data['key'], file_data['bucket'])
|
upload_file(os.path.join(dir.name, file_data['key']), file_data['key'], file_data['bucket'])
|
||||||
|
ws.clearData(True)
|
||||||
|
|
||||||
|
|
||||||
def run_task(query_type, params, files, url):
|
def run_task(query_type, params, files, url):
|
||||||
|
|||||||
Reference in New Issue
Block a user