Le 4 janv. 07 à 11:15, Jean-François a écrit :
gères-tu
pour les tables CodesPostaux, Distributeurs, Pays, ZonesGraphiques ?
Ce que je n’arrive pas à saisir c’est pourquoi ca ne passe pas que en
Production
voila mes migrations
class CreatePays < ActiveRecord::Migration
def self.up
create_table :Pays, :id => false, :primary_key => ‘CodePays’ do |t|
t.column :CodePays, :string
t.column :LibelleFr, :string
t.column :EstActif, :integer
end
end
def self.down
drop_table :Pays
end
end
class CreateZonesGraphiques < ActiveRecord::Migration
def self.up
create_table :ZonesGraphiques, :id => false, :primary_key =>
‘IDZoneGeographique’ do |t|
t.column :IDZoneGeographique, :integer
t.column :CodeZone, :string
t.column :Libelle, :string
t.column :CodePays, :string
end
end
def self.down
drop_table :ZonesGraphiques
end
end
class CreateCodesPostauxes < ActiveRecord::Migration
def self.up
create_table :CodesPostaux, :id => false, :primary_key =>
‘IDCodePostal’ do |t|
t.column :IDCodePostal, :integer
t.column :IDZoneGeographique, :integer
t.column :CodePostal, :string
t.column :ville, :string
end
end
def self.down
drop_table :CodesPostaux
end
end
class CreateDistributeurs < ActiveRecord::Migration
def self.up
create_table :Distributeurs, :id => false, :primary_key =>
‘IDDistributeur’ do |t|
t.column :IDDistributeur, :integer
t.column :CodeDistributeur, :integer
t.column :RaisonSociale, :string
t.column :AdresseL1, :string
t.column :AdresseL2, :string
t.column :Longitude, :float
t.column :Latitude, :float
t.column :IDCodePostal, :integer
t.column :IDZoneGeographique, :integer
t.column :CodePays, :string
end
end
def self.down
drop_table :Distributeurs
end
end
Arrives-tu à faire du CRUD avec ces tables ?
C’est à dire
Quel SGBRD utilises-tu ?
Pour l’instant je n’utilise que sqlite. J’attends que tout ca marque
et apres je utiliser au final un base MS SQL Server 2005
– Jean-François.
–
À la renverse.
Railsfrance mailing list
[email protected]
http://lists.rubyonrails.fr/mailman/listinfo/railsfrance
Bolo M.
[email protected]
http://blog.developpez.com/index.php?blog=30