$ bundle install
$ createdb tunr_db
$ psql -d tunr_db < db/schema.sql
$ psql -d tunr_db < db/seeds.sql
In the console:
- Find all artists
- Find just one artist by id
- Find Taylor Swift (or your other fav artist) by name.
- Find all artists from the USA
- Find all artists NOT from the USA
- Create a new artist for your favorite artist
- Change at least 2 of their attributes
- Destroy the artist you just created
- (NOTE: If you destroy other artists at this point, you'll need to reseed your data for consistency.)
Add another column to your artists
table called year
with type integer by editing your db/schema.sql
file. Then run reset your schema via the command line. Populate each artist with the appropriate year of origin.
Use Active Record queries to find all artists:
- since 2000
- between 1970 and 1995
- not in 2004 or 2015
- Create a file that will contain your AR class definition for Songs
- Make sure to link that file in your main application file
- Add corresponding associations to your models
In pry (via the console)...
- Find the artist with the name Enya
- Use AR methods to find all of Enya's songs, store them in a variable
- Get the first song out of those results and get that song's title
- Find the song with the title 'Unstoppable' and store in a variable
- Get that song's artist, store that in a variable
- Reassign the song's artist to be a different one (your choice)
- Save that song
- Create a new song, and associate it with a different artist of your choice
- Delete that song
- Find all of Enya's songs again, store in a variable
- Using
each
, iterate over those songs and for each song, print "I like" + the song name
Add a new table collaborations
to your application. Collaborations should join artists
and songs
should have name
and genre
columns. Change the relationships so that an artist
has many songs
and a song
has many artists
through collaborations
Create at least 5 collaborations between artists