feat(tf): add task id to state

This commit is contained in:
Denis Gukov 2024-12-16 05:00:44 +05:00
parent 8dabb527b4
commit 58c48c27e6
No known key found for this signature in database
GPG Key ID: 044381366A5D4731
2 changed files with 9 additions and 6 deletions

View File

@ -8,6 +8,7 @@ type TerraformInventoryAlias struct {
InventoryID int `db:"inventory_id" json:"inventory_id"`
AuthKeyID int `db:"auth_key_id" json:"auth_key_id"`
Alias string `db:"alias" json:"alias"`
TaskID *int `db:"task_id" json:"task_id"`
}
var TerraformInventoryAliasProps = ObjectProps{

View File

@ -1,8 +1,8 @@
create table project__terraform_inventory_alias(
`alias` varchar(100) primary key,
`project_id` int,
`inventory_id` int,
`auth_key_id` int,
`project_id` int NOT NULL,
`inventory_id` int NOT NULL,
`auth_key_id` int NOT NULL,
foreign key (`project_id`) references project(`id`) on delete cascade,
foreign key (`inventory_id`) references project__inventory(`id`) on delete cascade,
foreign key (`auth_key_id`) references access_key(`id`)
@ -10,10 +10,12 @@ create table project__terraform_inventory_alias(
create table project__terraform_inventory_state(
`id` integer primary key autoincrement,
`project_id` int,
`inventory_id` int,
`state` text,
`project_id` int NOT NULL,
`inventory_id` int NOT NULL,
`state` text NOT NULL,
`created` datetime NOT NULL,
`task_id` int,
foreign key (`task_id`) references task(`id`) on delete set null,
foreign key (`project_id`) references project(`id`) on delete cascade,
foreign key (`inventory_id`) references project__inventory(`id`) on delete cascade
);