24 lines
630 B
Ruby
24 lines
630 B
Ruby
|
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
|