Skip to content

Commit

Permalink
Création d'un modèle Note
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthieu Segret committed Jun 29, 2017
1 parent 00ca790 commit 6886220
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/note.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Note < ApplicationRecord
end
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
root 'welcome#hello'
get "welcome/hello/(:message)", to: "welcome#hello", as: :hello_welcome
get "welcome/goodbye", to: "welcome#goodbye", as: :goodbye_welcome
end
end
10 changes: 10 additions & 0 deletions db/migrate/20170629074542_create_notes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class CreateNotes < ActiveRecord::Migration[5.1]
def change
create_table :notes do |t|
t.string :title
t.text :content

t.timestamps
end
end
end
22 changes: 22 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20170629074542) do

create_table "notes", force: :cascade do |t|
t.string "title"
t.text "content"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

end

0 comments on commit 6886220

Please sign in to comment.