Skip to content
Snippets Groups Projects
Commit 1d7827bb authored by Martin Mareš's avatar Martin Mareš
Browse files

Revert "DB: Zavedení custom kódu kola"

Částečný revert commitu 702a9a20.
K upgradu DB přidán inverzní.
parent dde85749
No related branches found
No related tags found
No related merge requests found
...@@ -133,7 +133,6 @@ CREATE TABLE rounds ( ...@@ -133,7 +133,6 @@ CREATE TABLE rounds (
seq int NOT NULL, -- pořadí kola v kategorii (od 1) seq int NOT NULL, -- pořadí kola v kategorii (od 1)
part int NOT NULL DEFAULT 0, -- část kola (nenulová u dělených kol) part int NOT NULL DEFAULT 0, -- část kola (nenulová u dělených kol)
level int NOT NULL, -- úroveň hierarchie míst level int NOT NULL, -- úroveň hierarchie míst
code varchar(255) NOT NULL, -- kód kola ("1", "S" apod.)
name varchar(255) NOT NULL, -- zobrazované jméno ("Krajské kolo" apod.) name varchar(255) NOT NULL, -- zobrazované jméno ("Krajské kolo" apod.)
round_type round_type NOT NULL DEFAULT 'other', -- typ kola ("domácí", "školní" apod.) round_type round_type NOT NULL DEFAULT 'other', -- typ kola ("domácí", "školní" apod.)
state round_state NOT NULL DEFAULT 'preparing', -- stav kola state round_state NOT NULL DEFAULT 'preparing', -- stav kola
... ...
......
SET ROLE 'mo_osmo';
ALTER TABLE ROUNDS DROP COLUMN code;
...@@ -295,7 +295,6 @@ class Round(Base): ...@@ -295,7 +295,6 @@ class Round(Base):
seq = Column(Integer, nullable=False) seq = Column(Integer, nullable=False)
part = Column(Integer, nullable=False) part = Column(Integer, nullable=False)
level = Column(Integer, nullable=False) level = Column(Integer, nullable=False)
code = Column(String(255), nullable=False)
name = Column(String(255), nullable=False) name = Column(String(255), nullable=False)
round_type = Column(Enum(RoundType, name='round_type'), nullable=False, server_default=text("'other'::round_type")) round_type = Column(Enum(RoundType, name='round_type'), nullable=False, server_default=text("'other'::round_type"))
state = Column(Enum(RoundState, name='round_state'), nullable=False, server_default=text("'preparing'::round_state")) state = Column(Enum(RoundState, name='round_state'), nullable=False, server_default=text("'preparing'::round_state"))
...@@ -317,7 +316,7 @@ class Round(Base): ...@@ -317,7 +316,7 @@ class Round(Base):
def round_code_short(self): def round_code_short(self):
""" Pro samostatné kolo ekvivalentní s `round_code()`, pro skupinu kol společná část kódu. """ """ Pro samostatné kolo ekvivalentní s `round_code()`, pro skupinu kol společná část kódu. """
return f"{self.year}-{self.category}-{self.code}" return f"{self.year}-{self.category}-{self.seq}"
def part_code(self): def part_code(self):
return chr(ord('a') + self.part - 1) if self.part > 0 else "" return chr(ord('a') + self.part - 1) if self.part > 0 else ""
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment