Creating a database
CREATE DATABASE db_name;
Deleting a database
DROP DATABASE db_name;
Creating a table:
Partner up, and on your whiteboard tables, write out schema declarations for Animals and Employees, discussing what datatype and contraints best suit each attribute. Once you feel confident in your schemas, type them up in a .sql file and add it to your wdi database.
Design a schema such that each animal has the following attributes:
speciessex| # _ _ __ _ _ | |
| # | |__ __ _ ___| |__ _ __ _ __ ___ / _(_) | ___ | |
| # | '_ \ / _` / __| '_ \ | '_ \| '__/ _ \| |_| | |/ _ \ | |
| # | |_) | (_| \__ \ | | | | |_) | | | (_) | _| | | __/ | |
| # |_.__/ \__,_|___/_| |_| | .__/|_| \___/|_| |_|_|\___| | |
| # |_| | |
| # When Bash starts, it executes the commands in this script | |
| # http://en.wikipedia.org/wiki/Bash_(Unix_shell) | |
| # | |
| # Written by Philip Lamplugh, Instructor General Assembly (2013) |
| { | |
| "hot_exit": false, | |
| "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", | |
| "default_line_ending": "LF", | |
| "ensure_newline_at_eof_on_save": true, | |
| "font_face": "Courier New", | |
| "font_size": 18.0, | |
| "highlight_line": true, | |
| "remember_open_files": false, | |
| "scroll_past_end": true, |
| # Compiled source # | |
| ################### | |
| *.com | |
| *.class | |
| *.dll | |
| *.exe | |
| *.o | |
| *.so | |
| # Packages # |
| [user] | |
| name = github_name | |
| email = github_email | |
| [color] | |
| ui = always | |
| [core] | |
| editor = subl -w | |
| excludesfile = ~/.gitignore_global | |
| [commit] | |
| template = ~/.gitmessage.txt |
sudo apt-get install libxss1wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.debsudo dpkg -i google-chrome*.deb| pushing a project to heroku: | |
| ***if you're pushing to heroku you must add the following to config/application.rb, WITHIN the Application class: | |
| config.assets.initialize_on_precompile = false | |
| 1. heroku create (git remote -v shows we have remotes on heroku) | |
| ***if you used an environmental variable, heroku won't be able to access it, and you will have to tell heroku what the environmental variable and value are via the following line of code in the terminal: | |
| ***heroku config:set GITHUB_USERNAME=joesmith |
| development: | |
| adapter: postgresql | |
| encoding: unicode | |
| database: <%= File.basename(Rails.root) %>_development | |
| pool: 5 | |
| host: localhost | |
| username: <%= ENV['PG_USERNAME'] %> | |
| password: | |
| test: |