Skip to content

Master andromeda#1

Open
ilivor wants to merge 10000 commits intoilivor:masterfrom
13lackHawk:master-andromeda
Open

Master andromeda#1
ilivor wants to merge 10000 commits intoilivor:masterfrom
13lackHawk:master-andromeda

Conversation

@ilivor
Copy link
Owner

@ilivor ilivor commented Oct 21, 2025

Описание PR

Медиа

Проверки

  • PR полностью завершён и мне не нужна помощь чтобы его закончить.
  • Я внимательно просмотрел все свои изменения и багов в них не нашёл.
  • Я запускал локальный сервер со своими изменениями и всё протестировал.
  • Я добавил скриншот/видео демонстрации PR в игре, или этот PR этого не требует.

Изменения для игроков

🆑

  • add: Добавлено веселье!
  • remove: Убрано веселье!
  • tweak: Изменено веселье!
  • fix: Исправлено веселье!

Изменения для разработчиков

🆑

  • add: Добавлен код!
  • remove: Убран код!
  • tweak: Изменён код!
  • fix: Исправлен код!

NIKforest and others added 30 commits May 2, 2024 20:51
Работы от стажёров
Медведи и новый борг
How can ONE DATABASE COLUMN have so many cursed issues I don't know, but it certainly pissed off the devil in its previous life.

The start_date column on round entities in the database was added by space-wizards/space-station-14#21153. For some reason, this PR gave the column a nonsensical default value instead of making it nullable. This default value causes the code from #25280 to break. It actually trips an assert though that's not what the original issue report ran into.

This didn't get noticed on wizden servers because we at some point backfilled the start_date column based on the stored admin logs.

So I change the database model to make this column nullable, updated the C# code to match, and made the existing migration set the invalid values to be NULL instead. Cool.

Wait how's SQLite handle in this scenario anyways? Well actually turns out the column was *completely broken* in the first place!

The code for inserting into the round table was copy pasted between SQLite and PostgreSQL, with the only difference being that the SQLite key manually assigned the primary key instead of letting SQLite AUTOINCREMENT it. And then the code to give a start_date value was only added to the PostgreSQL version (which is actually in the base class already). So for SQLite that column's been filled up with the same invalid default the whole time.

Why was the code manually assigning a PK? I checked the SQLite docs for AUTOINCREMENT[1], and the behavior seems appropriate.

I removed the SQLite-specific code path and it just seems to work regardless. The migration just sets the old values to NULL too.

BUT WAIT, THERE'S MORE!

Turns out just doing the migration on SQLite is a pain in the ass! EF Core has to create a new table to apply the nullability change, because SQLite doesn't support proper ALTER COLUMN. This causes the generated SQL commands to be weird and the UPDATE for the migration goes BEFORE the nullability change... I ended up having to make TWO migrations for SQLite. Yay.

Fixes #26800

[1]: https://www.sqlite.org/autoinc.html
add: оповещение админов о поднятии важного предмета
ПР №2 Обновление игровых карт (QuickFix)
Memes YAML code by EvilBug
Waufuf and others added 30 commits May 21, 2024 15:59
Ликвидация ошибок с халатом учёного, ГВ, скафами НРа, утиля и шахтёра.
add: В аплинк синдиката добавлена катана
Перетащил катану в Лемирдный каталог
New Syndicate Items - Soul Katana and Devil's Mask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.