Databases
From Buildtools
Contents
MYSQL SERVERS
Sync Procedure
- Developer will request to sync main db(develop database) with his db changes, then production and other dbs will be sync with develop.
Best Practices
- For column names use: all lowercase, underscore to separte words.
- For boolean columns use tiny(1).
- Comment everywhere!, please add coments to all new created column.
- use prefix dt_ for date/data-time columns
structure ====zgcg s needs an ID unique hsxgolumn.chch olumn its /_.нащмншч
- cumn its required./-_
- cmn its required.
Debugging MySQL queries
- Just open any endpoint and add get param debug=true
- For example:
- https://stonewoodtest.buildtools.com/api/v1/usersgroups?debug=true
- You will see somthing like:
- time Query bindings
- 38.78 select * from `company_info` limit 1
- 1.39 select * from `user_groups_permissions` where `user_groups_id` = ? 1
- 0.39 select count(*) as aggregate from `custom_fields` where `modules_code` = ?
- 0.26 select count(*) as aggregate from `custom_fields` where `modules_code` = ?
- 50.13 select `id`, `description`, `access_level`, `type`, `template_id` from `user_groups`
MONGO SERVERS
Installation
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
- sudo apt- get update
- sudo apt-get install -y mongodb-org
Clients
- Robomongo GUI WIN [[1]]
Configuring
- mkdir -p /data/db
- service mongod restart
Throubleshooting
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install gcc-4.8
- rm /usr/bin/gcc
- rm /usr/bin/g++
- ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
- ln -s /usr/bin/g++-4.8 /usr/bin/g++
- sudo apt-get install libstdc++6