-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMsSqlAWT2Postgres.conf
89 lines (89 loc) · 3.3 KB
/
MsSqlAWT2Postgres.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
* This is an example config file for migrating the sample AdventureWorks database from MS SQL Server to Postgres
* by using the template ms-sql-server.conf, which makes this file much smaller and simpler.
* See https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/adventure-works
*/
{
/**
* Migration project name
*/
"name": "AdventureWorks",
/**
* Template that will be used for DDL and DML settings. The settings from this file
* will be merged with the template's settings. If a template is not used
* then all of the settings must be in this config file.
*
* The ms-sql-server template can be seen at
* https://github.com/isapir/Migrate2Postgres/blob/master/src/main/resources/templates/ms-sql-server.conf
*/
"template": "ms-sql-server",
/**
* The information_schema.database_name value is used by information_schema.query in the
* ms-sql-server template to determine which objects to migrate
*/
"information_schema": {
"database_name": "AdventureWorks"
},
/**
* Defines the available database connections. Each connection must
* have a connectionString key. Other keys are optional and will be
* added to the Properties object when connecting to the database.
*/
"connections": {
"mssql": {
"connectionString": "jdbc:sqlserver://localhost:1433",
"user": "%connections.mssql.user%",
"password": "%connections.mssql.password%",
/** example referencing another key instead of repeating it */
"databaseName": "%information_schema.database_name%"
},
"postgres": {
"connectionString": "jdbc:postgresql://localhost:5432/adventure_works",
"user": "postgres",
"password": ""
}
},
/**
* The name of the connection for the source (copy from) database
*/
"source": "mssql",
/**
* The name of the connection for the target (copy to) database
*/
"target": "postgres",
/**
* Mappings for schema names from source to target, e.g. HumanResources -> hr
*/
"schema_mapping": {
"dbo": "public",
"HumanResources": "hr"
},
/**
* Mappings for table names from source to target, e.g. HumanResources -> hr
* runs before table_transform
*/
"table_mapping": {
"ProductModelProductDescriptionCulture": "ProductModelProdDescCulture"
},
/**
* Mappings for column names in case the source db has keyword names like "group"
* or "primary", or has a space that we want to remove.
* runs before column_transform
*/
"column_mapping": {
"Database Version": "db_version",
"group": "group_name",
"primary": "is_primary"
},
/**
* Specify whether to transform the table and/or column names. Available transforms are:
* lower_case - transforms MyTableName to mytablename
* upper_case - transforms MyTableName to MYTABLENAME
* camel_to_snake_case - transforms MyTableName to my_table_name
*/
"table_transform": "camel_to_snake_case",
"column_transform": "camel_to_snake_case",
"dml": {
"threads": 5
}
}