* Refactor task_attempt branch handling and enforce NOT NULL constraint on branch column * Change backend rebase to no change base branch, add change target branch api * Change frontend rebase on branch to change target branch Change status to show ahead/behind, always show rebase * Use target branch for everything except rebase * Remove base_branch * Remove base branch frontend * add rebase dialog with target and upstream options * Fix unused upstream arg * Add i18n * Remove stray ts-rs file * dont show +0, -0 * Move upstream to foldable advanced rebase * Move buttons around * Move git state/actions into a component * Add task/target labels * Fix action buttons layout * Fmt * i18n * remove branch origin removal * Remove empty divs * Remove [1fr_auto_1fr] class in favour if divs * use theme colours, make gear icon bigger * Fix plural i18n * Remove legacy ui reducer
19 lines
760 B
SQL
19 lines
760 B
SQL
-- Make branch column NOT NULL by recreating it
|
|
-- First update any NULL values to 'main'
|
|
-- Note: NULL values should not exist in practice, this is just a safety measure
|
|
UPDATE task_attempts SET branch = 'main' WHERE branch IS NULL;
|
|
|
|
-- 1) Create replacement column (NOT NULL TEXT)
|
|
ALTER TABLE task_attempts ADD COLUMN branch_new TEXT NOT NULL DEFAULT 'main';
|
|
|
|
-- 2) Copy existing values
|
|
UPDATE task_attempts SET branch_new = branch;
|
|
|
|
-- 3) Remove the old nullable column
|
|
ALTER TABLE task_attempts DROP COLUMN branch;
|
|
|
|
-- 4) Keep the original column name
|
|
ALTER TABLE task_attempts RENAME COLUMN branch_new TO branch;
|
|
|
|
-- Rename base_branch to target_branch now that we only need one column
|
|
ALTER TABLE task_attempts RENAME COLUMN base_branch TO target_branch; |