Skip to content

Commit

Permalink
feat: Feature release v7 sql scripts (#5757)
Browse files Browse the repository at this point in the history
* sql scripts

* release channel schema

* script number chnage

* is exposed

* sql script chnage

* script number chnage
  • Loading branch information
Shivam-nagar23 committed Sep 9, 2024
1 parent d38a408 commit 5727221
Show file tree
Hide file tree
Showing 2 changed files with 209 additions and 0 deletions.
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);


0 comments on commit 5727221

Please sign in to comment.