mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 01:19:01 +08:00
Add first stub for profile database
CURA-6096
This commit is contained in:
parent
0348293f87
commit
3f80fcb5e5
@ -44,6 +44,32 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
# is added, we check to see if an extruder stack needs to be added.
|
||||
self.containerAdded.connect(self._onContainerAdded)
|
||||
|
||||
@override(ContainerRegistry)
|
||||
def _createDatabaseFile(self, db_path: str) -> None:
|
||||
connection = super()._createDatabaseFile(db_path)
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("""
|
||||
CREATE TABLE qualities(
|
||||
id text,
|
||||
name text,
|
||||
quality_type text,
|
||||
material text,
|
||||
variant text,
|
||||
global_quality bool,
|
||||
definition text
|
||||
);
|
||||
CREATE UNIQUE INDEX idx_qualities_id on qualities (id);
|
||||
|
||||
CREATE TABLE variants(
|
||||
id text,
|
||||
name text,
|
||||
hardware_type text,
|
||||
definition text
|
||||
);
|
||||
CREATE UNIQUE INDEX idx_variants_id on variants (id);
|
||||
""")
|
||||
return connection
|
||||
|
||||
@override(ContainerRegistry)
|
||||
def addContainer(self, container: ContainerInterface) -> bool:
|
||||
"""Overridden from ContainerRegistry
|
||||
|
Loading…
x
Reference in New Issue
Block a user