Sqlite databases create fixed. Added some template

This commit is contained in:
Sergey Kalinin 2017-12-04 13:11:55 +03:00
parent 9cc5c6cd57
commit 9904d5b4e9
2 changed files with 274 additions and 0 deletions

View File

@ -0,0 +1,72 @@
{
"tables": [
{
"tableName": "type",
"tableDescription": "Тип элемента",
"fieldList": [
{
"fName": "id",
"fDescription": "Номер п.п.",
"fType": "INT(6)",
"index": "PRIMARY KEY",
"autoIncrement": "yes",
"relation": []
},
{
"fName": "name",
"fDescription": "Тип элемента",
"fType": "char(20)",
"index": "yes",
"autoIncrement": "no",
"relation": []
}
]
},
{
"tableName": "items",
"tableDescription": "Элементы",
"fieldList": [
{
"fName": "id",
"fDescription": "Номер п.п.",
"fType": "INTEGER",
"index": "PRIMARY KEY",
"autoIncrement": "yes",
"relation": []
},
{
"fName": "item_name",
"fDescription": "Наименование",
"fType": "varchar(100)",
"index": "yes",
"autoIncrement": "no",
"relation": []
},
{
"fName": "description",
"fDescription": "Описание",
"fType": "varchar(200)",
"index": "no",
"autoIncrement": "no",
"relation": []
},
{
"fName": "type_id",
"fDescription": "Тип",
"fType": "INTEGER",
"index": "no",
"autoIncrement": "no",
"relation": ["type.id", "name"]
},
{
"fName": "count",
"fDescription": "Количество",
"fType": "INTEGER",
"index": "no",
"autoIncrement": "no",
"relation": []
}
]
}
]
}

202
db_template/tables.json Normal file
View File

@ -0,0 +1,202 @@
{
"tables": [
{
"tableName": "users",
"tableDescription": "Пользователи",
"fieldList": [
{
"fName": "id",
"fDescription": "Номер п.п.",
"fType": "INT(6)",
"index": "PRIMARY KEY",
"autoIncrement": "yes",
"relation": []
},
{
"fName": "login",
"fDescription": "Логин",
"fType": "char(20)",
"index": "yes",
"autoIncrement": "no",
"relation": []
},
{
"fName": "password",
"fDescription": "Пароль",
"fType": "char(20)",
"index": "no",
"autoIncrement": "no",
"relation": []
},
{
"fName": "last_name",
"fDescription": "Фамилия",
"fType": "char(20)",
"index": "no",
"autoIncrement": "no",
"relation": []
},
{
"fName": "name",
"fDescription": "Имя",
"fType": "char(20)",
"index": "no",
"autoIncrement": "no",
"relation": []
},
{
"fName": "middle_name",
"fDescription": "Отчество",
"fType": "char(20)",
"index": "no",
"autoIncrement": "no",
"relation": []
}
]
},
{
"tableName": "docs",
"tableDescription": "Документы",
"fieldList": [
{
"fName": "id",
"fDescription": "Номер п.п.",
"fType": "INTEGER",
"index": "PRIMARY KEY",
"autoIncrement": "yes",
"relation": []
},
{
"fName": "doc_name",
"fDescription": "Наименование",
"fType": "varchar(100)",
"index": "yes",
"autoIncrement": "no",
"relation": []
},
{
"fName": "description",
"fDescription": "Описание",
"fType": "varchar(200)",
"index": "no",
"autoIncrement": "no",
"relation": []
},
{
"fName": "users_id",
"fDescription": "Владелец",
"fType": "INTEGER",
"index": "no",
"autoIncrement": "no",
"relation": ["users.id", "last_name, name, middle_name"]
},
{
"fName": "parent_id",
"fDescription": "Родительский документ",
"fType": "INTEGER",
"index": "no",
"autoIncrement": "no",
"relation": ["docs.id", "doc_name"]
}
]
},
{
"tableName": "address",
"tableDescription": "Адреса",
"fieldList": [
{
"fName": "id",
"fDescription": "Номер п.п.",
"fType": "INTEGER",
"index": "PRIMARY KEY",
"autoIncrement": "yes",
"relation": []
},
{
"fName": "region",
"fDescription": "Регион",
"fType": "varchar(100)",
"index": "yes",
"autoIncrement": "no",
"relation": []
},
{
"fName": "city",
"fDescription": "Населеннй пункт",
"fType": "varchar(200)",
"index": "no",
"autoIncrement": "no",
"relation": []
},
{
"fName": "street",
"fDescription": "Улица",
"fType": "varchar(100)",
"index": "no",
"autoIncrement": "no",
"relation": []
},
{
"fName": "house",
"fDescription": "Дом",
"fType": "char(6)",
"index": "no",
"autoIncrement": "no",
"relation": []
}
]
},
{
"tableName": "test",
"tableDescription": "Шляпа",
"fieldList": [
{
"fName": "id",
"fDescription": "Номер п.п.",
"fType": "INTEGER",
"index": "PRIMARY KEY",
"autoIncrement": "yes",
"relation": []
},
{
"fName": "user",
"fDescription": "Юзер шляпы",
"fType": "int(11)",
"index": "no",
"autoIncrement": "no",
"relation": ["users.id", "last_name, name, middle_name"]
}
]
},
{
"tableName": "test2",
"tableDescription": "Шляпа2",
"fieldList": [
{
"fName": "id",
"fDescription": "Номер п.п.",
"fType": "INTEGER",
"index": "PRIMARY KEY",
"autoIncrement": "yes",
"relation": []
},
{
"fName": "ins_date",
"fDescription": "Дата добавления",
"fType": "DATETIME",
"index": "no",
"autoIncrement": "no",
"relation": []
},
{
"fName": "user",
"fDescription": "Юзер шляпы",
"fType": "int(11)",
"index": "no",
"autoIncrement": "no",
"relation": ["users.id", "last_name, name, middle_name"]
}
]
}
]
}