Simon Bruder
00d7647187
While diesel has a native rust interface, writing more complex queries is easier when you can just pass a SQL query string.
14 lines
281 B
SQL
14 lines
281 B
SQL
-- SPDX-FileCopyrightText: 2024 Simon Bruder <simon@sbruder.de>
|
|
--
|
|
-- SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
ALTER TABLE items
|
|
ALTER name DROP NOT NULL;
|
|
|
|
UPDATE items
|
|
SET name = NULL
|
|
WHERE name = '';
|
|
|
|
ALTER TABLE items
|
|
ADD CONSTRAINT name_not_empty CHECK(name <> '');
|