Add database setup
This commit is contained in:
parent
7a494f7918
commit
8a858e6fc2
|
@ -1 +1,3 @@
|
||||||
Assets/__titlepage.filled.tex
|
Assets/__titlepage.filled.tex
|
||||||
|
Design.org
|
||||||
|
Code/.env
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
[[source]]
|
||||||
|
name = "pypi"
|
||||||
|
url = "https://pypi.org/simple"
|
||||||
|
verify_ssl = true
|
||||||
|
|
||||||
|
[dev-packages]
|
||||||
|
|
||||||
|
[packages]
|
||||||
|
flask = "*"
|
||||||
|
sqlalchemy = "*"
|
||||||
|
pymysql = "*"
|
||||||
|
|
||||||
|
[requires]
|
||||||
|
python_version = "3.8"
|
|
@ -0,0 +1,105 @@
|
||||||
|
{
|
||||||
|
"_meta": {
|
||||||
|
"hash": {
|
||||||
|
"sha256": "536bc13b89021a4575fe2c14d71636abf965ab896871f1503f3186f2f1c6a0d4"
|
||||||
|
},
|
||||||
|
"pipfile-spec": 6,
|
||||||
|
"requires": {
|
||||||
|
"python_version": "3.8"
|
||||||
|
},
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"name": "pypi",
|
||||||
|
"url": "https://pypi.org/simple",
|
||||||
|
"verify_ssl": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"default": {
|
||||||
|
"click": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13",
|
||||||
|
"sha256:5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7"
|
||||||
|
],
|
||||||
|
"version": "==7.0"
|
||||||
|
},
|
||||||
|
"flask": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:13f9f196f330c7c2c5d7a5cf91af894110ca0215ac051b5844701f2bfd934d52",
|
||||||
|
"sha256:45eb5a6fd193d6cf7e0cf5d8a5b31f83d5faae0293695626f539a823e93b13f6"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==1.1.1"
|
||||||
|
},
|
||||||
|
"itsdangerous": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19",
|
||||||
|
"sha256:b12271b2047cb23eeb98c8b5622e2e5c5e9abd9784a153e9d8ef9cb4dd09d749"
|
||||||
|
],
|
||||||
|
"version": "==1.1.0"
|
||||||
|
},
|
||||||
|
"jinja2": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:74320bb91f31270f9551d46522e33af46a80c3d619f4a4bf42b3164d30b5911f",
|
||||||
|
"sha256:9fe95f19286cfefaa917656583d020be14e7859c6b0252588391e47db34527de"
|
||||||
|
],
|
||||||
|
"version": "==2.10.3"
|
||||||
|
},
|
||||||
|
"markupsafe": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473",
|
||||||
|
"sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161",
|
||||||
|
"sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235",
|
||||||
|
"sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5",
|
||||||
|
"sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff",
|
||||||
|
"sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b",
|
||||||
|
"sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1",
|
||||||
|
"sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e",
|
||||||
|
"sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183",
|
||||||
|
"sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66",
|
||||||
|
"sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1",
|
||||||
|
"sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1",
|
||||||
|
"sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e",
|
||||||
|
"sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b",
|
||||||
|
"sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905",
|
||||||
|
"sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735",
|
||||||
|
"sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d",
|
||||||
|
"sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e",
|
||||||
|
"sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d",
|
||||||
|
"sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c",
|
||||||
|
"sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21",
|
||||||
|
"sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2",
|
||||||
|
"sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5",
|
||||||
|
"sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b",
|
||||||
|
"sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6",
|
||||||
|
"sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f",
|
||||||
|
"sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f",
|
||||||
|
"sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"
|
||||||
|
],
|
||||||
|
"version": "==1.1.1"
|
||||||
|
},
|
||||||
|
"pymysql": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:3943fbbbc1e902f41daf7f9165519f140c4451c179380677e6a848587042561a",
|
||||||
|
"sha256:d8c059dcd81dedb85a9f034d5e22dcb4442c0b201908bede99e306d65ea7c8e7"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==0.9.3"
|
||||||
|
},
|
||||||
|
"sqlalchemy": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:bfb8f464a5000b567ac1d350b9090cf081180ec1ab4aa87e7bca12dab25320ec"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==1.3.12"
|
||||||
|
},
|
||||||
|
"werkzeug": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:7280924747b5733b246fe23972186c6b348f9ae29724135a6dfc1e53cea433e7",
|
||||||
|
"sha256:e5f4a1f98b52b18a93da705a7458e55afb26f32bff83ff5d19189f92462d65c4"
|
||||||
|
],
|
||||||
|
"version": "==0.16.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"develop": {}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
from sqlalchemy import create_engine
|
||||||
|
|
||||||
|
|
||||||
|
def create_connection():
|
||||||
|
db_name = get_env_variable("DB_NAME")
|
||||||
|
db_user = get_env_variable("DB_USER")
|
||||||
|
db_password = get_env_variable("DB_PASSWORD")
|
||||||
|
db_url = get_env_variable("DB_URL")
|
||||||
|
db_connection_uri = "mysql+pymysql://{user}:{pw}@{url}/{db}".format(
|
||||||
|
user=db_user, pw=db_password, url=db_url, db=db_name
|
||||||
|
)
|
||||||
|
engine = sqlalchemy.create_engine(db_connection_uri, echo=True)
|
||||||
|
|
||||||
|
|
||||||
|
def get_env_variable(name):
|
||||||
|
try:
|
||||||
|
return os.environ[name]
|
||||||
|
except KeyError:
|
||||||
|
message = "Expected environment variable '{}' not set.".format(name)
|
||||||
|
raise Exception(message)
|
47
Design.org
47
Design.org
|
@ -1,47 +1,58 @@
|
||||||
* DB
|
* DB
|
||||||
** Fields
|
** ID
|
||||||
*** ID
|
** Location
|
||||||
*** Location
|
** Area change
|
||||||
*** Area change
|
** Volume change
|
||||||
*** Volume change
|
** Name
|
||||||
*** Name
|
|
||||||
* Users
|
* Users
|
||||||
** Admin
|
** Admin
|
||||||
* Tasks
|
* Tasks
|
||||||
** TODO Parsing script [0/2] [0%]
|
** Specification
|
||||||
- [ ] Select useful fiels with awk
|
*** TODO Improve second handout [0/2] [0%]
|
||||||
- [ ] Sum of the volume and areas of each year
|
- [ ] Correct diagrams
|
||||||
** DONE Type requirements handout [4/4] [100%]
|
- [ ] Add conceptual diagram
|
||||||
|
*** INACTIVE Update date in YAML automatically [0/1] [0%]
|
||||||
|
- [ ] Add to Makefile
|
||||||
|
*** DONE Type requirements handout [4/4] [100%]
|
||||||
CLOSED: [2019-09-27 Fri 14:54] SCHEDULED: <2019-09-27 Fri 23:55>
|
CLOSED: [2019-09-27 Fri 14:54] SCHEDULED: <2019-09-27 Fri 23:55>
|
||||||
- [X] Problem description
|
- [X] Problem description
|
||||||
- [X] Functional requirements
|
- [X] Functional requirements
|
||||||
- [X] Data requirements
|
- [X] Data requirements
|
||||||
- [X] Semantic restrictions
|
- [X] Semantic restrictions
|
||||||
** DONE Makefile [3/3] [100%]
|
*** DONE Makefile [3/3] [100%]
|
||||||
CLOSED: [2019-09-30 Mon 20:05]
|
CLOSED: [2019-09-30 Mon 20:05]
|
||||||
- [X] Org to Markdown
|
- [X] Org to Markdown
|
||||||
- [X] Add YAML to Markdown
|
- [X] Add YAML to Markdown
|
||||||
- [X] Compile to PDF using Eisvogel
|
- [X] Compile to PDF using Eisvogel
|
||||||
** TODO Update date in YAML automatically [0/2] [0%]
|
*** DONE Add WGMS citation [2/2] [100%]
|
||||||
- [ ] Awk command
|
|
||||||
- [ ] Add to Makefile
|
|
||||||
** DONE Add WGMS citation [2/2] [100%]
|
|
||||||
CLOSED: [2019-10-08 Tue 18:16]
|
CLOSED: [2019-10-08 Tue 18:16]
|
||||||
- [X] Pandoc citations
|
- [X] Pandoc citations
|
||||||
- [X] Bibtex syntax
|
- [X] Bibtex syntax
|
||||||
** DONE Setup PlantUML integration [2/2] [100%]
|
*** DONE Setup PlantUML integration [2/2] [100%]
|
||||||
CLOSED: [2019-10-18 Fri 17:58]
|
CLOSED: [2019-10-18 Fri 17:58]
|
||||||
- [X] Org Babel
|
- [X] Org Babel
|
||||||
- [X] Source code on a different file
|
- [X] Source code on a different file
|
||||||
** DONE Improve first handout [3/3] [100%]
|
*** DONE Improve first handout [3/3] [100%]
|
||||||
CLOSED: [2019-10-08 Tue 20:45]
|
CLOSED: [2019-10-08 Tue 20:45]
|
||||||
- [X] Data types
|
- [X] Data types
|
||||||
- [X] Non functional requirements
|
- [X] Non functional requirements
|
||||||
- [X] Longer description
|
- [X] Longer description
|
||||||
** DONE Generate diagrams [4/5] [80%]
|
*** DONE Generate diagrams [4/5] [80%]
|
||||||
CLOSED: [2019-11-01 Fri 00:34]
|
CLOSED: [2019-11-01 Fri 00:34]
|
||||||
- [X] Data-flow
|
- [X] Data-flow
|
||||||
- [ ] Conceptual
|
- [ ] Conceptual
|
||||||
- [X] Functional
|
- [X] Functional
|
||||||
- [X] Black box
|
- [X] Black box
|
||||||
- [X] Entity-Relationship
|
- [X] Entity-Relationship
|
||||||
|
** Implementation
|
||||||
|
*** TODO Backend [0/2] [0%]
|
||||||
|
**** TODO Database [1/2] [50%]
|
||||||
|
- [X] Connection
|
||||||
|
- [ ] Creation of fields via class
|
||||||
|
**** NEXT Flask framework
|
||||||
|
-[[https://flask.palletsprojects.com/en/1.1.x/patterns/#patterns][ Patterns]]
|
||||||
|
*** NEXT Parsing script [0/2] [0%]
|
||||||
|
- [ ] Select useful fiels with awk
|
||||||
|
- [ ] Arithmetic operations for comparisons
|
||||||
|
*** INACTIVE Frontend [0/1] [0%]
|
||||||
|
- [ ] [[https://adminlte.io/][Adminlte]]
|
||||||
|
|
|
@ -137,8 +137,9 @@
|
||||||
#+CAPTION: IGDB
|
#+CAPTION: IGDB
|
||||||
[[./BB.png]]
|
[[./BB.png]]
|
||||||
|
|
||||||
|
\clearpage
|
||||||
|
|
||||||
*** Diagrama Entidad-Relación
|
*** Diagrama Entidad-Relación
|
||||||
\newpage
|
|
||||||
|
|
||||||
[[./ER.png]]
|
[[./ER.png]]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue