mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
e117ace8c7
Summary: Ref T9252. Drydock currently uses integer statuses, but there's no reason for this (they don't need to be ordered) and it makes debugging them, working with them, future APIs, etc., more cumbersome. Switch to string instead. Also rename `STATUS_OPEN` to `STATUS_ACTIVE` and `STATUS_CLOSED` to `STATUS_RELEASED` for consistency. This makes resources and leases have more similar states, and gives resource states more accurate names. Test Plan: Browsed web UI, grepped for changed constants, applied patch, inspected database. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9252 Differential Revision: https://secure.phabricator.com/D14153
39 lines
1.2 KiB
SQL
39 lines
1.2 KiB
SQL
ALTER TABLE {$NAMESPACE}_drydock.drydock_lease
|
|
CHANGE status status VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT};
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_lease
|
|
SET status = 'pending' WHERE status = '0';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_lease
|
|
SET status = 'acquired' WHERE status = '5';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_lease
|
|
SET status = 'active' WHERE status = '1';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_lease
|
|
SET status = 'released' WHERE status = '2';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_lease
|
|
SET status = 'broken' WHERE status = '3';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_lease
|
|
SET status = 'destroyed' WHERE status = '4';
|
|
|
|
|
|
ALTER TABLE {$NAMESPACE}_drydock.drydock_resource
|
|
CHANGE status status VARCHAR(32) NOT NULL COLLATE {$COLLATE_TEXT};
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_resource
|
|
SET status = 'pending' WHERE status = '0';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_resource
|
|
SET status = 'active' WHERE status = '1';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_resource
|
|
SET status = 'released' WHERE status = '2';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_resource
|
|
SET status = 'broken' WHERE status = '3';
|
|
|
|
UPDATE {$NAMESPACE}_drydock.drydock_resource
|
|
SET status = 'destroyed' WHERE status = '4';
|