Skip to content
Snippets Groups Projects
Commit 8e627506 authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Přidání sloupečku hidden do tabulky Place

parent 0c14e70b
Branches
No related tags found
1 merge request!106Účastníkům při výběru školy nezobrazujeme skrytá místa
...@@ -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);
......
SET ROLE 'mo_osmo';
ALTER TABLE places ADD COLUMN
hidden boolean NOT NULL DEFAULT false;
...@@ -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')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment