Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm committed Dec 19, 2024
1 parent 08c3568 commit a61cdb0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions atlasaction/testdata/templates/schema-plan-md.txtar
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
render-schema-plan schema-plan/md data-1.json
cmp stdout expected-1.md
cmp stdout golden-1.md

render-schema-plan schema-plan/md data-2.json
cmp stdout expected-2.md
cmp stdout golden-2.md

render-schema-plan schema-plan/md data-3.json
cmp stdout expected-3.md
-- expected-1.md --
cmp stdout golden-3.md
-- data-1.json --
{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:39445","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Repo":"bitbucket-e2e","Lint":{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:39445","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Schema":{},"Steps":[{"Name":"Analyze pr-1-VwDs28An.sql","Text":"0 reports were found in analysis","Result":{"Name":"pr-1-VwDs28An.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n"}}],"Files":[{"Name":"pr-1-VwDs28An.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n"}]},"File":{"Name":"pr-1-VwDs28An","FromHash":"VwDs28An8dyAzzfEHiqF9k9XiotM5uDQxXSXp0mKWFA=","ToHash":"ae2Xr0Ir2B5ztK//Jdtg7x/CvffsebUWBZL25wdE4dc=","Migration":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n","Stmts":[{"Pos":24,"Text":"ALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;","Comments":["-- Modify \"Image\" table\n"]}],"URL":"atlas://bitbucket-e2e/plans/pr-1-VwDs28An","Link":"https://ariga-atlas.atlasgo.cloud/schemas/141733923334/plans/210453398560","Status":"PENDING"}}
-- golden-1.md --
### Atlas detected changes to the desired schema

#### Migration Plan ([View on Atlas Cloud](https://ariga-atlas.atlasgo.cloud/schemas/141733923334/plans/210453398560))
Expand Down Expand Up @@ -39,9 +41,9 @@ the database with the desired state. Otherwise, Atlas will report a schema drift
```bash
atlas schema plan push --pending --file pr-1-VwDs28An.plan.hcl
```
-- data-1.json --
{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:39445","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Repo":"bitbucket-e2e","Lint":{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:39445","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Schema":{},"Steps":[{"Name":"Analyze pr-1-VwDs28An.sql","Text":"0 reports were found in analysis","Result":{"Name":"pr-1-VwDs28An.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n"}}],"Files":[{"Name":"pr-1-VwDs28An.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n"}]},"File":{"Name":"pr-1-VwDs28An","FromHash":"VwDs28An8dyAzzfEHiqF9k9XiotM5uDQxXSXp0mKWFA=","ToHash":"ae2Xr0Ir2B5ztK//Jdtg7x/CvffsebUWBZL25wdE4dc=","Migration":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n","Stmts":[{"Pos":24,"Text":"ALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;","Comments":["-- Modify \"Image\" table\n"]}],"URL":"atlas://bitbucket-e2e/plans/pr-1-VwDs28An","Link":"https://ariga-atlas.atlasgo.cloud/schemas/141733923334/plans/210453398560","Status":"PENDING"}}
-- expected-2.md --
-- data-2.json --
{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:39445","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Repo":"bitbucket-e2e","Lint":{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:39445","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Schema":{},"Steps":[{"Name":"Analyze pr-1-VwDs28An.sql","Text":"0 reports were found in analysis","Result":{"Name":"pr-1-VwDs28An.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n"}}],"Files":[{"Name":"pr-1-VwDs28An.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n"}]},"File":null}
-- golden-2.md --
### Atlas detected changes to the desired schema

#### Atlas lint results
Expand All @@ -50,11 +52,9 @@ atlas schema plan push --pending --file pr-1-VwDs28An.plan.hcl
| :----: | :--- | :----- |
| ![](https://release.ariga.io/images/assets/success.svg?v=1) | | |
| ![](https://release.ariga.io/images/assets/success.svg?v=1) | No issues found | |
-- data-2.json --
{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:39445","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Repo":"bitbucket-e2e","Lint":{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:39445","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Schema":{},"Steps":[{"Name":"Analyze pr-1-VwDs28An.sql","Text":"0 reports were found in analysis","Result":{"Name":"pr-1-VwDs28An.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n"}}],"Files":[{"Name":"pr-1-VwDs28An.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] ADD [StorageKey] nvarchar(255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL;\n"}]},"File":null}
-- data-3.json --
{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:35283","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Repo":"bitbucket-e2e","Lint":{"Env":{"Driver":"sqlserver","URL":{"Scheme":"sqlserver","Opaque":"","User":{},"Host":"host.docker.internal:35283","Path":"","RawPath":"","OmitHost":false,"ForceQuery":false,"RawQuery":"database=master\u0026mode=database","Fragment":"","RawFragment":"","Schema":""}},"Schema":{},"Steps":[{"Name":"Analyze pr-3-ae2Xr0Ir.sql","Text":"1 reports were found in analysis","Result":{"Name":"pr-3-ae2Xr0Ir.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] DROP COLUMN [Description];\n-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] DROP COLUMN [StorageKey];\n","Reports":[{"Text":"destructive changes detected","Diagnostics":[{"Pos":24,"Text":"Dropping non-virtual column \"Description\"","Code":"DS103","SuggestedFixes":[{"Message":"Add a pre-migration check to ensure column \"Description\" is NULL before dropping it"}]},{"Pos":106,"Text":"Dropping non-virtual column \"StorageKey\"","Code":"DS103","SuggestedFixes":[{"Message":"Add a pre-migration check to ensure column \"StorageKey\" is NULL before dropping it"}]}]}],"Error":"destructive changes detected"}}],"Files":[{"Name":"pr-3-ae2Xr0Ir.sql","Text":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] DROP COLUMN [Description];\n-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] DROP COLUMN [StorageKey];\n","Reports":[{"Text":"destructive changes detected","Diagnostics":[{"Pos":24,"Text":"Dropping non-virtual column \"Description\"","Code":"DS103","SuggestedFixes":[{"Message":"Add a pre-migration check to ensure column \"Description\" is NULL before dropping it"}]},{"Pos":106,"Text":"Dropping non-virtual column \"StorageKey\"","Code":"DS103","SuggestedFixes":[{"Message":"Add a pre-migration check to ensure column \"StorageKey\" is NULL before dropping it"}]}]}],"Error":"destructive changes detected"}]},"File":{"Name":"pr-3-ae2Xr0Ir","FromHash":"ae2Xr0Ir2B5ztK//Jdtg7x/CvffsebUWBZL25wdE4dc=","ToHash":"DntscM4aNcMzI+ZL/0DLj29fGfIjTaYaUYydNFa4cqE=","Migration":"-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] DROP COLUMN [Description];\n-- Modify \"Image\" table\nALTER TABLE [MySchema].[Image] DROP COLUMN [StorageKey];\n","Stmts":[{"Pos":24,"Text":"ALTER TABLE [MySchema].[Image] DROP COLUMN [Description];","Comments":["-- Modify \"Image\" table\n"]},{"Pos":106,"Text":"ALTER TABLE [MySchema].[Image] DROP COLUMN [StorageKey];","Comments":["-- Modify \"Image\" table\n"]}],"URL":"atlas://bitbucket-e2e/plans/pr-3-ae2Xr0Ir","Link":"https://ariga-atlas.atlasgo.cloud/schemas/141733923334/plans/210453398623","Status":"PENDING"}}
-- expected-3.md --
-- golden-3.md --
### Atlas detected changes to the desired schema

#### Migration Plan ([View on Atlas Cloud](https://ariga-atlas.atlasgo.cloud/schemas/141733923334/plans/210453398623))
Expand Down

0 comments on commit a61cdb0

Please sign in to comment.