mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 13:29:05 +01:00
Fix truncate call on mysql and provide step 4 migrations for mysql
This commit is contained in:
parent
df240c2394
commit
a183c23e25
@ -126,6 +126,9 @@ func (r *JobRepository) Flush() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
case "mysql":
|
case "mysql":
|
||||||
|
if _, err = r.DB.Exec(`SET FOREIGN_KEY_CHECKS = 0`); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
if _, err = r.DB.Exec(`TRUNCATE TABLE jobtag`); err != nil {
|
if _, err = r.DB.Exec(`TRUNCATE TABLE jobtag`); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -135,6 +138,9 @@ func (r *JobRepository) Flush() error {
|
|||||||
if _, err = r.DB.Exec(`TRUNCATE TABLE job`); err != nil {
|
if _, err = r.DB.Exec(`TRUNCATE TABLE job`); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if _, err = r.DB.Exec(`SET FOREIGN_KEY_CHECKS = 1`); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE job
|
||||||
|
MODIFY `partition` VARCHAR(255) NOT NULL,
|
||||||
|
MODIFY array_job_id BIGINT NOT NULL,
|
||||||
|
MODIFY num_hwthreads INT NOT NULL,
|
||||||
|
MODIFY num_acc INT NOT NULL;
|
@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE job
|
||||||
|
MODIFY `partition` VARCHAR(255),
|
||||||
|
MODIFY array_job_id BIGINT,
|
||||||
|
MODIFY num_hwthreads INT,
|
||||||
|
MODIFY num_acc INT;
|
Loading…
Reference in New Issue
Block a user