Grosse MàJ
This commit is contained in:
@ -0,0 +1,23 @@
|
||||
class CreateUtilisateurs < ActiveRecord::Migration
|
||||
db_name = ActiveRecord::Base::connection.current_database()
|
||||
execute "ALTER DATABASE #{db_name} CHARACTER SET utf8 COLLATE utf8_general_ci"
|
||||
|
||||
def self.up
|
||||
create_table :utilisateurs do |t|
|
||||
t.column :nom, :string
|
||||
t.column :prenom, :string
|
||||
t.column :classe, :string
|
||||
t.column :email, :string
|
||||
t.column :age, :int[3]
|
||||
t.column :rue, :string
|
||||
t.column :codePostal, :int[5]
|
||||
t.column :ville, :string
|
||||
t.column :photo, :image
|
||||
t.column :type, :string
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table :utilisateurs
|
||||
end
|
||||
end
|
21
P5B/ruby/3dossmanno_annuaire/db/migrate/002_create_users.rb
Normal file
21
P5B/ruby/3dossmanno_annuaire/db/migrate/002_create_users.rb
Normal file
@ -0,0 +1,21 @@
|
||||
class CreateUsers < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table "users", :force => true do |t|
|
||||
t.column :login, :string
|
||||
t.column :email, :string
|
||||
t.column :crypted_password, :string, :limit => 40
|
||||
t.column :salt, :string, :limit => 40
|
||||
t.column :created_at, :datetime
|
||||
t.column :updated_at, :datetime
|
||||
t.column :remember_token, :string
|
||||
t.column :remember_token_expires_at, :datetime
|
||||
|
||||
t.column :activation_code, :string, :limit => 40
|
||||
t.column :activated_at, :datetime
|
||||
end
|
||||
end
|
||||
|
||||
def self.down
|
||||
drop_table "users"
|
||||
end
|
||||
end
|
37
P5B/ruby/3dossmanno_annuaire/db/schema.rb
Normal file
37
P5B/ruby/3dossmanno_annuaire/db/schema.rb
Normal file
@ -0,0 +1,37 @@
|
||||
# This file is autogenerated. Instead of editing this file, please use the
|
||||
# migrations feature of ActiveRecord to incrementally modify your database, and
|
||||
# then regenerate this schema definition.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 6) do
|
||||
|
||||
create_table "addresses", :force => true do |t|
|
||||
t.column "street", :text
|
||||
t.column "postal_code", :string
|
||||
t.column "city", :string
|
||||
t.column "country", :string
|
||||
end
|
||||
|
||||
create_table "customers", :force => true do |t|
|
||||
t.column "firstname", :string
|
||||
t.column "name", :string
|
||||
end
|
||||
|
||||
create_table "products", :force => true do |t|
|
||||
t.column "designation", :string
|
||||
t.column "description", :text
|
||||
t.column "created_at", :datetime
|
||||
t.column "updated_at", :datetime
|
||||
t.column "supplier_id", :integer
|
||||
t.column "customer_id", :integer
|
||||
t.column "type", :string
|
||||
end
|
||||
|
||||
create_table "suppliers", :force => true do |t|
|
||||
t.column "name", :string
|
||||
t.column "description", :text
|
||||
t.column "code", :string
|
||||
t.column "created_at", :datetime
|
||||
t.column "updated_at", :datetime
|
||||
end
|
||||
|
||||
end
|
Reference in New Issue
Block a user