Skip to content

feat: Feature release v7 sql scripts #5757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 9, 2024
3 changes: 3 additions & 0 deletions scripts/sql/285_release_channel.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DELETE FROM devtron_resource_schema where devtron_resource_id in (select id from devtron_resource where kind in('release-channel'));

DELETE FROM devtron_resource where kind in('release-channel');
206 changes: 206 additions & 0 deletions scripts/sql/285_release_channel.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
INSERT INTO devtron_resource(kind, display_name, icon,is_exposed, parent_kind_id, deleted, created_on, created_by, updated_on,
updated_by)
VALUES ('release-channel', 'Release Channel', '',false, 0, false, now(), 1, now(), 1);

INSERT INTO devtron_resource_schema(devtron_resource_id, version, schema, sample_schema, latest, created_on, created_by, updated_on,
updated_by)
VALUES ((select id from devtron_resource where kind = 'release-channel'), 'alpha1',
'{
"type": "object",
"title": "Release Channel Schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required":
[
"version",
"kind",
"overview"
],
"properties":
{
"kind":
{
"const": "release-channel"
},
"version":
{
"enum":
[
"alpha1"
],
"type": "string"
},
"overview":
{
"type": "object",
"properties":
{
"id":
{
"type": "number"
},
"icon":
{
"type": "string",
"format": "uri"
},
"name":
{
"type": "string"
},
"tags":
{
"additionalProperties":
{
"type": "string"
}
},
"idType":
{
"enum":
[
"resourceObjectId",
"oldObjectId"
],
"type": "string"
},
"default":
{
"type": "boolean"
},
"metadata":
{
"type": "object",
"properties":
{}
},
"createdBy":
{
"type": "object",
"refType": "#/references/users"
},
"createdOn":
{
"type": "string"
},
"description":
{
"type": "string"
},
"releaseChannelId":
{
"type": "string"
}
},
"required":
[
"id",
"idType",
"releaseChannelId"
]
},
"dependencies":
{
"type": "array"
}
}
}','{
"type": "object",
"title": "Release Channel Schema",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"required":
[
"version",
"kind",
"overview"
],
"properties":
{
"kind":
{
"const": "release-channel"
},
"version":
{
"enum":
[
"alpha1"
],
"type": "string"
},
"overview":
{
"type": "object",
"properties":
{
"id":
{
"type": "number"
},
"icon":
{
"type": "string",
"format": "uri"
},
"name":
{
"type": "string"
},
"tags":
{
"additionalProperties":
{
"type": "string"
}
},
"idType":
{
"enum":
[
"resourceObjectId",
"oldObjectId"
],
"type": "string"
},
"default":
{
"type": "boolean"
},
"metadata":
{
"type": "object",
"properties":
{}
},
"createdBy":
{
"type": "object",
"refType": "#/references/users"
},
"createdOn":
{
"type": "string"
},
"description":
{
"type": "string"
},
"releaseChannelId":
{
"type": "string"
}
},
"required":
[
"id",
"idType",
"releaseChannelId"
]
},
"dependencies":
{
"type": "array"
}
}
}',true, now(), 1, now(), 1);