Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
212cdb38
authored
Nov 29, 2026
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix datastore uniqueness constraint
parent
8db3512f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletions
+24
-1
circle/storage/migrations/0009_alter_datastore_path_alter_datastore_unique_together.py
+22
-0
circle/storage/models.py
+2
-1
No files found.
circle/storage/migrations/0009_alter_datastore_path_alter_datastore_unique_together.py
0 → 100644
View file @
212cdb38
# Generated by Django 4.2.30 on 2026-11-29 12:05
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'storage'
,
'0008_disk_cluster_size'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'datastore'
,
name
=
'path'
,
field
=
models
.
CharField
(
max_length
=
200
,
verbose_name
=
'path'
),
),
migrations
.
AlterUniqueTogether
(
name
=
'datastore'
,
unique_together
=
{(
'hostname'
,
'path'
)},
),
]
circle/storage/models.py
View file @
212cdb38
...
@@ -50,7 +50,7 @@ class DataStore(Model):
...
@@ -50,7 +50,7 @@ class DataStore(Model):
"""Collection of virtual disks.
"""Collection of virtual disks.
"""
"""
name
=
CharField
(
max_length
=
100
,
unique
=
True
,
verbose_name
=
_
(
'name'
))
name
=
CharField
(
max_length
=
100
,
unique
=
True
,
verbose_name
=
_
(
'name'
))
path
=
CharField
(
max_length
=
200
,
unique
=
True
,
verbose_name
=
_
(
'path'
))
path
=
CharField
(
max_length
=
200
,
verbose_name
=
_
(
'path'
))
hostname
=
CharField
(
max_length
=
40
,
unique
=
False
,
hostname
=
CharField
(
max_length
=
40
,
unique
=
False
,
verbose_name
=
_
(
'hostname'
))
verbose_name
=
_
(
'hostname'
))
driver_cache
=
CharField
(
max_length
=
20
,
unique
=
False
,
verbose_name
=
_
(
'cache-mode - qemu'
),
default
=
'none'
)
driver_cache
=
CharField
(
max_length
=
20
,
unique
=
False
,
verbose_name
=
_
(
'cache-mode - qemu'
),
default
=
'none'
)
...
@@ -59,6 +59,7 @@ class DataStore(Model):
...
@@ -59,6 +59,7 @@ class DataStore(Model):
ordering
=
[
'name'
]
ordering
=
[
'name'
]
verbose_name
=
_
(
'datastore'
)
verbose_name
=
_
(
'datastore'
)
verbose_name_plural
=
_
(
'datastores'
)
verbose_name_plural
=
_
(
'datastores'
)
unique_together
=
((
'hostname'
,
'path'
),)
def
__str__
(
self
):
def
__str__
(
self
):
return
'
%
s (
%
s)'
%
(
self
.
name
,
self
.
path
)
return
'
%
s (
%
s)'
%
(
self
.
name
,
self
.
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment