Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Commits
8e627506
Commit
8e627506
authored
3 years ago
by
Jiří Kalvoda
Browse files
Options
Downloads
Patches
Plain Diff
Přidání sloupečku hidden do tabulky Place
parent
0c14e70b
Branches
Branches containing commit
No related tags found
1 merge request
!106
Účastníkům při výběru školy nezobrazujeme skrytá místa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
db/db.ddl
+2
-1
2 additions, 1 deletion
db/db.ddl
db/upgrade-20211120.sql
+4
-0
4 additions, 0 deletions
db/upgrade-20211120.sql
mo/db.py
+1
-0
1 addition, 0 deletions
mo/db.py
with
7 additions
and
1 deletion
db/db.ddl
+
2
−
1
View file @
8e627506
...
@@ -52,7 +52,8 @@ CREATE TABLE places (
...
@@ -52,7 +52,8 @@ CREATE TABLE places (
code varchar(255) UNIQUE COLLATE "cs_CZ", -- zkratka pro zadávání
code varchar(255) UNIQUE COLLATE "cs_CZ", -- zkratka pro zadávání
type place_type NOT NULL,
type place_type NOT NULL,
nuts varchar(255) UNIQUE DEFAULT NULL, -- evropský NUTS/LAU kód regionu
nuts varchar(255) UNIQUE DEFAULT NULL, -- evropský NUTS/LAU kód regionu
note text NOT NULL DEFAULT '' -- uživatelská poznámka
note text NOT NULL DEFAULT '', -- uživatelská poznámka
hidden boolean NOT NULL DEFAULT false -- schovat pro účastníky
);
);
CREATE INDEX places_parent_index ON places (parent);
CREATE INDEX places_parent_index ON places (parent);
...
...
This diff is collapsed.
Click to expand it.
db/upgrade-20211120.sql
0 → 100644
+
4
−
0
View file @
8e627506
SET
ROLE
'mo_osmo'
;
ALTER
TABLE
places
ADD
COLUMN
hidden
boolean
NOT
NULL
DEFAULT
false
;
This diff is collapsed.
Click to expand it.
mo/db.py
+
1
−
0
View file @
8e627506
...
@@ -107,6 +107,7 @@ class Place(Base):
...
@@ -107,6 +107,7 @@ class Place(Base):
type
=
Column
(
Enum
(
PlaceType
,
name
=
'
place_type
'
),
nullable
=
False
)
type
=
Column
(
Enum
(
PlaceType
,
name
=
'
place_type
'
),
nullable
=
False
)
nuts
=
Column
(
String
(
255
),
unique
=
True
,
server_default
=
text
(
"
NULL::character varying
"
))
nuts
=
Column
(
String
(
255
),
unique
=
True
,
server_default
=
text
(
"
NULL::character varying
"
))
note
=
Column
(
Text
,
nullable
=
False
,
server_default
=
text
(
"''
::text
"
))
note
=
Column
(
Text
,
nullable
=
False
,
server_default
=
text
(
"''
::text
"
))
hidden
=
Column
(
Boolean
,
server_default
=
text
(
"
false
"
),
nullable
=
False
)
parent_place
=
relationship
(
'
Place
'
,
primaryjoin
=
'
Place.parent == Place.place_id
'
,
remote_side
=
'
Place.place_id
'
)
parent_place
=
relationship
(
'
Place
'
,
primaryjoin
=
'
Place.parent == Place.place_id
'
,
remote_side
=
'
Place.place_id
'
)
children
=
relationship
(
'
Place
'
)
children
=
relationship
(
'
Place
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment