Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
#9: Isolate mysql generated columns from integration tests so the bui…
Browse files Browse the repository at this point in the history
…ld can execute, for now, without these features
  • Loading branch information
laingsimon committed Mar 2, 2021
1 parent d8e8124 commit 01bcc01
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 8 deletions.
10 changes: 10 additions & 0 deletions TestScenarios/Read_AllColumnTypes/#9-Database.MySql.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CREATE TABLE `Person` (
Id int not null auto_increment primary key,
Name nvarchar(255) not null,
Title varchar(10),
Age int,
Price decimal(18, 2),
DoB date,
Deleted bit(1) not null default 0,
PriceIncVat decimal(18, 2) AS (`Price` * 1.2)
);
45 changes: 45 additions & 0 deletions TestScenarios/Read_AllColumnTypes/#9-ExpectedOutput.MySql.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"tables": {
"`Person`": {
"columns": {
"Id": {
"type": "int",
"nullable": false,
"primaryKey": true
},
"Name": {
"type": "nvarchar(255)",
"nullable": false,
"primaryKey": false
},
"Title": {
"type": "varchar(10)",
"primaryKey": false
},
"Age": {
"type": "int",
"primaryKey": false
},
"Price": {
"type": "decimal(18,2)",
"primaryKey": false
},
"DoB": {
"type": "date",
"primaryKey": false
},
"Deleted": {
"type": "bit(1)",
"nullable": false,
"default": 0,
"primaryKey": false
},
"PriceIncVat": {
"expression": "`Price` * 1.2",
"primaryKey": false,
"type": "decimal(18,2)"
}
}
}
}
}
3 changes: 1 addition & 2 deletions TestScenarios/Read_AllColumnTypes/Database.MySql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ CREATE TABLE `Person` (
Age int,
Price decimal(18, 2),
DoB date,
Deleted bit(1) not null default 0,
PriceIncVat decimal(18, 2) AS (`Price` * 1.2)
Deleted bit(1) not null default 0
);
5 changes: 0 additions & 5 deletions TestScenarios/Read_AllColumnTypes/ExpectedOutput.MySql.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
"nullable": false,
"default": 0,
"primaryKey": false
},
"PriceIncVat": {
"expression": "`Price` * 1.2",
"primaryKey": false,
"type": "decimal(18,2)"
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion TestScenarios/Read_AllColumnTypes/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
This scenario tests vcdb to confirm it can create the expected schema JSON from a given database.

This scenario tests that all built in SQL data types can be read correctly.
This scenario tests that all built in SQL data types can be read correctly.

MySql generated columns are supported from mysql v8, however the build environment doesn't support mysql v8 & sqlserver at the same time, see issue #9.
Until this issue is resolved, all tests need to be paired back to what mysql v5.7.3 supports.

0 comments on commit 01bcc01

Please sign in to comment.