code
stringlengths
1
1.73M
language
stringclasses
1 value
class CreateCentros < ActiveRecord::Migration def self.up create_table :centros do |t| t.column :nombre_comercial, :string, :null => false, :limit => 40 t.column :razon_social, :string, :null => false, :limit => 40 t.column :rfc, :string, :null => false, :limit => 15 t.column :fecha_aniver...
Ruby
class CreateEjecutivos < ActiveRecord::Migration def self.up create_table :ejecutivos do |t| t.column :nombre, :string, :limit => 40, :null => false t.column :primer_apellido, :string, :limit => 40, :null => false t.column :segundo_apellido, :string, :limit => 40 t.column :usuario, :string...
Ruby
class AddEjecutivoAlmacen < ActiveRecord::Migration def self.up add_column :ejecutivos, :almacen_id, :integer end def self.down remove_column :ejecutivos, :almacen_id end end
Ruby
class CreateEvaluacionPremios < ActiveRecord::Migration def self.up create_table :evaluacion_premios do |t| t.column :evaluacion_id, :integer t.column :participante_id, :integer, :null => false t.column :marca_id, :integer, :null => false t.column :venta_copas, :integer, :null => false ...
Ruby
class CreateSalidaMateriales < ActiveRecord::Migration def self.up create_table :salida_materiales do |t| t.column :ejecutivo_id, :integer t.column :centro_id, :integer t.column :observaciones, :text t.column :importe, :decimal, :precision => 12, :scale => 2 t.column :created_at, :da...
Ruby
class ChangeBonificacionDetallesVolumen < ActiveRecord::Migration def self.up remove_column :bonificacion_detalles, :volumen add_column :bonificacion_detalles, :volumen, :decimal, :precision => 10, :scale => 2 end def self.down remove_column :bonificacion_detalles, :volumen add_column :bonificaci...
Ruby
class RemoveBonificacionesAplicableA < ActiveRecord::Migration def self.up remove_column :bonificaciones, :aplicable_a end def self.down add_column :bonificaciones, :aplicable_a, :integer, :default => 1 end end
Ruby
class CreateConcursoVentas < ActiveRecord::Migration def self.up create_table :concurso_ventas do |t| t.column :concurso_id, :integer, :null => false t.column :marca_id, :integer, :null => false t.column :puntos_copa, :integer t.column :puntos_botella, :integer end end ...
Ruby
class CreatePresenciaExhibiciones < ActiveRecord::Migration def self.up create_table :presencia_exhibiciones do |t| t.column :presencia_id, :integer t.column :producto_id, :integer t.column :cantidad, :integer t.column :en_atencion_a, :string t.column :observaciones, :text end ...
Ruby
class CreateBusquedaPresencias < ActiveRecord::Migration def self.up sql="CREATE VIEW busqueda_presencias AS SELECT centros.presencias.id, centros.presencias.centro_id, centros.presencias.nombre, centros.presencias.ejecutivo_id, centros.presencias.created_at, "+ "centros.presencias.status_id, centros.centro...
Ruby
class AddBonificacionesObjetivo < ActiveRecord::Migration def self.up add_column :bonificaciones, :objetivo_mensual, :integer end def self.down remove_column :bonificaciones, :objetivo_mensual end end
Ruby
class AddFacturasUserId < ActiveRecord::Migration def self.up add_column :facturas, :user_id, :integer end def self.down remove_column :facturas, :user_id end end
Ruby
class CreateEmpleados < ActiveRecord::Migration def self.up create_table :empleados do |t| t.column :nombre, :string, :limit => 40, :null => false t.column :primer_apellido, :string, :limit => 40, :null => false t.column :segundo_apellido, :string, :limit => 40 t.column :fecha_nacimiento, ...
Ruby
class AddVCorteMensual < ActiveRecord::Migration def self.up sql = "CREATE VIEW v_corte_mensual AS SELECT CONVERT(varchar, YEAR(centros.bonificacion_detalles.fecha_bonificacion)) + '/' + CONVERT(varchar, " + "MONTH(centros.bonificacion_detalles.fecha_bonificacion)) AS month_bonificacion, centros.bonificacio...
Ruby
class AddEntradaValorParentValueId < ActiveRecord::Migration def self.up add_column :entradas_catalogos, :parent_value_id, :integer, :default => nil, :null => true end def self.down remove_column :entradas_catalogos, :parent_value_id end end
Ruby
class AddPromocionPresupuestos < ActiveRecord::Migration def self.up add_column :promociones, :presupuesto_producto_id, :integer add_column :promociones, :presupuesto_apoyo_id, :integer end def self.down remove_column :promociones, :presupuesto_apoyo_id remove_column :promociones, :presupuesto_pr...
Ruby
class AddCentrosRegion < ActiveRecord::Migration def self.up add_column :centros , :region_id, :integer end def self.down remove_column :centros, :region_id end end
Ruby
class CreateDetalleFacturas < ActiveRecord::Migration def self.up create_table :detalle_facturas do |t| t.column :factura_id, :integer, :null => false t.column :producto_id, :integer, :null => false t.column :unidades, :integer, :null => false t.column :precio_unitario, :decima...
Ruby
class RemoveGrupoArticulos < ActiveRecord::Migration def self.up drop_table :grupo_articulos end def self.down create_table :grupo_articulos do |t| t.column :descripcion, :string t.column :sector_id, :integer t.column :categoria_id, :integer end end end
Ruby
class CreateMarcas < ActiveRecord::Migration def self.up create_table :marcas do |t| t.column :familia_id, :integer t.column :empresa_id, :integer t.column :categoria_id, :integer t.column :nombre, :string t.column :status_id, :integer t.column :created_at, :datetime t.co...
Ruby
class CreateExistencias < ActiveRecord::Migration def self.up create_table :existencias do |t| t.column :almacen_id, :integer t.column :producto_id, :integer t.column :cantidad, :integer t.column :created_at, :datetime t.column :updated_at, :datetime t.column :user_id, :integer...
Ruby
class CreateBonificacionDetalles < ActiveRecord::Migration def self.up create_table :bonificacion_detalles do |t| t.column :centro_id, :integer t.column :convenio_id, :integer t.column :destino_id, :integer t.column :volumen, :float t.column :operacion, :integer t.column :impor...
Ruby
class CreateMovimientoAlmacenes < ActiveRecord::Migration def self.up create_table :movimiento_almacenes do |t| t.column :referencia, :string t.column :tipo_movimiento_id, :integer t.column :almacen_id, :integer t.column :created_at, :datetime t.column :updated_at, :datetime t....
Ruby
class AddPresenciasNombre < ActiveRecord::Migration def self.up add_column :presencias, :nombre, :string end def self.down remove_column :presencias, :nombre end end
Ruby
class AddCorporativoEjecutivo < ActiveRecord::Migration def self.up add_column :corporativos, :ejecutivo_id, :integer end def self.down remove_column :corporativos, :ejecutivo_id end end
Ruby
class CreateItemRequisiciones < ActiveRecord::Migration def self.up create_table :item_requisiciones do |t| t.column :requisicion_producto_id, :integer t.column :cantidad, :integer t.column :unidad_medida_id, :integer t.column :producto_id, :integer t.column :created_at, :datetime ...
Ruby
class RemoveProductosGrupoArticuloId < ActiveRecord::Migration def self.up remove_column :productos, :grupo_articulo_id end def self.down add_column :productos, :grupo_articulo_id, :integer end end
Ruby
class AddProductosColumnas < ActiveRecord::Migration def self.up add_column :productos, :nombre, :string add_column :productos, :puntos_canje, :integer add_column :productos, :costo_cuervo, :decimal, :precision => 10, :scale => 2 add_column :productos, :precio_venta, :decimal, :precision => 10, :scale...
Ruby
class CreateBusquedaPromociones < ActiveRecord::Migration def self.up sql="CREATE VIEW busqueda_promociones AS SELECT centros.promociones.id, centros.promociones.centro_id, centros.centros.nombre_comercial, "+ "centros.promociones.ejecutivo_id, centros.ejecutivos.nombre as ejecutivo_nombre, centros.ejecutiv...
Ruby
class CreateOrdenSalidaPresupuestos < ActiveRecord::Migration def self.up create_table :orden_salida_presupuestos do |t| t.column :presupuesto_id, :integer t.column :disponible, :decimal, :precision => 12, :scale => 2 t.column :created_at, :datetime t.column :updated_at, :datetime end ...
Ruby
class ChangeCentrosColumnsSize < ActiveRecord::Migration def self.up change_column :centros, :nombre_comercial, :string, :limit => 60, :null => false change_column :centros, :razon_social, :string, :limit => 90, :null => false change_column :centros, :calle, :string, :limit => 75, :null => false chang...
Ruby
class AddProductosEmpresaId < ActiveRecord::Migration def self.up add_column :productos, :empresa_id, :integer execute "UPDATE productos set empresa_id = 1" end def self.down remove_column :productos, :empresa_id end end
Ruby
class AddCatalogoParentId < ActiveRecord::Migration def self.up add_column :catalogos, :parent_id, :integer, :null => true, :default => nil end def self.down remove_column :catalogos, :parent_id end end
Ruby
class AddOrdenSalidaAutorizarId < ActiveRecord::Migration def self.up add_column :orden_salidas, :autorizar_id, :integer, :default => 0 end def self.down remove_column :orden_salidas, :autorizar_id end end
Ruby
class AddProductosClave < ActiveRecord::Migration def self.up add_column :productos, :clave, :string end def self.down remove_column :productos, :clave end end
Ruby
class ChangePresenciaMateriales < ActiveRecord::Migration def self.up change_column :presencia_materiales, :costo_unitario, :decimal, :precision => 10, :scale => 2 end def self.down change_column :presencia_materiales, :costo_unitario, :decimal end end
Ruby
class RemovePresenciaExhibicionObservaciones < ActiveRecord::Migration def self.up remove_column :presencia_exhibiciones, :en_atencion_a remove_column :presencia_exhibiciones, :observaciones end def self.down add_column :presencia_exhibiciones, :observaciones, :text add_column :presencia_exhibici...
Ruby
class AddCentroCatalogos < ActiveRecord::Migration def self.up add_column :centros, :corporativo_id, :integer add_column :centros, :nivel_id, :integer end def self.down remove_column :centros, :corporativo_id remove_column :centros, :nivel_id end end
Ruby
class CreatePresenciaMateriales < ActiveRecord::Migration def self.up create_table :presencia_materiales do |t| t.column :presencia_id, :integer t.column :material_id, :integer t.column :cantidad, :integer t.column :costo_unitario, :decimal t.column :descripcion, :string end en...
Ruby
class AddFacturasCentro < ActiveRecord::Migration def self.up add_column :facturas, :centro_id, :integer end def self.down remove_column :facturas, :centro_id end end
Ruby
class CreateCatalogos < ActiveRecord::Migration def self.up create_table :catalogos do |t| t.column :nombre, :string, :limit => 40, :null => false t.column :descripcion, :text end end def self.down drop_table :catalogos end end
Ruby
class AddConcursosMinimoCumplimiento < ActiveRecord::Migration def self.up add_column :concursos, :minimo_cumplimiento_centro, :integer, :default => 0 add_column :concursos, :minimo_cumplimiento_tripulacion, :integer, :default => 0 end def self.down remove_column :concursos, :minimo_cumplimiento_cent...
Ruby
class CreateConcursoObjetivos < ActiveRecord::Migration def self.up create_table :concurso_objetivos do |t| t.column :concurso_id, :integer, :null => false t.column :objetivo, :string, :null => false t.column :puntos, :integer, :null => false end end def self.down drop_tabl...
Ruby
class CreateCanjes < ActiveRecord::Migration def self.up create_table :canjes do |t| t.column :evaluacion_id, :integer t.column :empleado_id, :integer end end def self.down drop_table :canjes end end
Ruby
class RemoveConveniosDuracion < ActiveRecord::Migration def self.up remove_column :convenios, :duracion end def self.down add_column :convenios, :duracion, :integer end end
Ruby
class CreateEvaluacionVentas < ActiveRecord::Migration def self.up create_table :evaluacion_ventas do |t| t.column :evaluacion_id, :integer, :null => false t.column :participante_id, :integer, :null => false t.column :marca_id, :integer, :null => false t.column :venta_copas, :integer ...
Ruby
class AddStatusId < ActiveRecord::Migration def self.up # productos add_column :productos, :status_id, :integer, :default => 0 execute 'update productos set status_id = 1' # empleados add_column :empleados, :status_id, :integer, :default => 0 execute 'update empleados set status_id = 1' ...
Ruby
class AddSalidaMaterialesFolio < ActiveRecord::Migration def self.up add_column :salida_materiales, :folio, :string end def self.down remove_column :salida_materiales, :folio end end
Ruby
class AddApoyoMaterialesDescripcion < ActiveRecord::Migration def self.up add_column :apoyo_materiales, :descripcion, :string end def self.down remove_column :apoyo_materiales, :descripcion end end
Ruby
class CreateConcursoPremios < ActiveRecord::Migration def self.up create_table :concurso_premios do |t| t.column :lugar, :integer, :null => false t.column :premio_id, :integer, :null => false t.column :otro, :string, :null => true end end def self.down drop_table :concurso_p...
Ruby
class CreateEvaluaciones < ActiveRecord::Migration def self.up create_table :evaluaciones do |t| t.column :concurso_id, :integer, :null => false t.column :ejecutivo_id, :integer, :null => false t.column :fecha_evaluacion, :date, :null => false t.column :created_at, :datetime t.column...
Ruby
class RemovePromocionTipoPresupuestoId < ActiveRecord::Migration def self.up remove_column :presencias, :tipo_presupuesto_id remove_column :promociones, :presupuesto_apoyo_id remove_column :promociones, :presupuesto_producto_id end def self.down add_column :promociones, :presupuesto_producto_id, ...
Ruby
class CreateGrupoArticulos < ActiveRecord::Migration def self.up create_table :grupo_articulos do |t| t.column :descripcion, :string t.column :sector_id, :integer t.column :categoria_id, :integer end end def self.down drop_table :grupo_articulos end end
Ruby
class ChangeNumSize < ActiveRecord::Migration def self.up change_column :centros, :num_exterior, :string, :limit => 20, :null => false change_column :centros, :num_interior, :string, :limit => 20, :null => true end def self.down change_column :centros, :num_interior, :string, :limit => 5, :null => tr...
Ruby
class AddEjecutivosRegionId < ActiveRecord::Migration def self.up add_column :ejecutivos, :region_id, :integer end def self.down remove_column :ejecutivos, :region_id end end
Ruby
class AddCentroContacto < ActiveRecord::Migration def self.up add_column :centros, :contacto, :string, :limit => 40 add_column :centros, :puesto_contacto_id, :integer end def self.down remove_column :centros, :puesto_contacto_id remove_column :centros, :contacto end end
Ruby
class AddConcursoTipo < ActiveRecord::Migration def self.up add_column :concursos, :tipo, :integer, :null => false, :default => 0 end def self.down remove_column :concursos, :tipo end end
Ruby
class CreateEmpresas < ActiveRecord::Migration def self.up create_table :empresas do |t| t.column :nombre, :string t.column :status_id, :integer t.column :created_at, :datetime t.column :updated_at, :datetime end end def self.down drop_table :empresas end end
Ruby
class CreateConcursoPremioMarcas < ActiveRecord::Migration def self.up create_table :concurso_premio_marcas do |t| t.column :concurso_id, :integer, :null => false t.column :marca_id, :integer, :null => false end end def self.down drop_table :concurso_premio_marcas end end
Ruby
class AddOrdenSalidasPresupuestoSuficiente < ActiveRecord::Migration def self.up add_column :orden_salidas, :presupuesto_suficiente, :boolean, :default => false end def self.down remove_column :orden_salias, :presupuesto_suficiente end end
Ruby
class AddEjecutivosStatusId < ActiveRecord::Migration def self.up add_column :ejecutivos, :status_id, :integer, :default => 0 execute 'update ejecutivos set status_id = 1' end def self.down remove_column :ejecutivos, :status_id end end
Ruby
class CreateAlmacenes < ActiveRecord::Migration def self.up create_table :almacenes do |t| t.column :nombre, :string t.column :descripcion, :text t.column :ubicacion, :string t.column :status_id, :integer, :default => 1 t.column :created_at, :datetime t.column :updated_at, :dat...
Ruby
class CreateBusquedaProductos < ActiveRecord::Migration def self.up sql = "CREATE VIEW busqueda_productos AS SELECT centros.productos.id, centros.productos.descripcion, centros.productos.clave, centros.marcas.nombre, centros.productos.status_id, centros.productos.marca_id, "+ "ISNULL(centros.productos.desc...
Ruby
class CentrosChangeContactoField < ActiveRecord::Migration def self.up rename_column :centros, :contacto, :nombre_contacto end def self.down rename_column :centros, :nombre_contacto, :contacto end end
Ruby
class AddCompromisosConvenio < ActiveRecord::Migration def self.up add_column :compromisos, :convenio_id, :integer end def self.down remove_column :compromisos, :convenio_id end end
Ruby
class CreateOrdenSalidas < ActiveRecord::Migration def self.up create_table :orden_salidas do |t| t.column :centro_id, :integer t.column :en_atencion_de, :string t.column :domicilio, :text t.column :observaciones, :text t.column :monto_total, :decimal, :precision => 14, :scale => 2 ...
Ruby
class AddCorporativosContacto < ActiveRecord::Migration def self.up add_column :corporativos, :nombre_contacto, :string end def self.down remove_column :corporativos, :nombre_contacto end end
Ruby
class AddMissingColumns < ActiveRecord::Migration def self.up add_column :centros, :created_at, :datetime add_column :centros, :updated_at, :datetime add_column :facturas, :ejecutivo_id, :integer end def self.down remove_column :facturas, :ejecutivo_id remove_column :centros, :...
Ruby
class CreateSolicitudMaterialDetalles < ActiveRecord::Migration def self.up create_table :solicitud_material_detalles do |t| t.column :solicitud_material_id, :integer t.column :material_id, :integer t.column :cantidad, :integer t.column :costo_unitario, :decimal t.column :descripcion...
Ruby
class AddPuntajeMeserosFechas < ActiveRecord::Migration def self.up add_column :puntaje_meseros, :created_at, :datetime add_column :puntaje_meseros, :updated_at, :datetime end def self.down remove_column :puntaje_meseros, :upated_at remove_column :puntaje_meseros, :created_at end end
Ruby
class AddOrdenSalidaTipoPresupuesto < ActiveRecord::Migration def self.up add_column :orden_salidas, :tipo_presupuesto_id, :integer end def self.down remove_column :orden_salidas, :tipo_presupuesto_id end end
Ruby
class CreateCategorias < ActiveRecord::Migration def self.up create_table :categorias do |t| t.column :nombre, :string t.column :status_id, :string t.column :created_at, :datetime t.column :updated_at, :datetime end end def self.down drop_table :categorias end end
Ruby
class EmpleadoRemoveColumns < ActiveRecord::Migration def self.up remove_column(:empleados, :fecha_nacimiento) remove_column(:empleados, :estado_civil_id) end def self.down add_column :empleados, :fecha_nacimiento, :date add_column :empleados, :estado_civil_id, :integer end end
Ruby
class CreateEntradasCatalogos < ActiveRecord::Migration def self.up create_table :entradas_catalogos do |t| t.column :valor, :string, :null => false, :limit => 40 t.column :esta_activo, :boolean, :default => true t.column :catalogo_id, :integer end end def self.down drop_table :entr...
Ruby
class CreatePresupuestoDetalles < ActiveRecord::Migration def self.up create_table :presupuesto_detalles do |t| t.column :presupuesto_id, :integer t.column :operacion, :integer t.column :importe, :decimal, :precision => 12, :scale => 2, :default => 0.0 t.column :referencia, :string t...
Ruby
class CreateConvenios < ActiveRecord::Migration def self.up create_table :convenios do |t| t.column :fecha_inicio, :date, :null => false t.column :duracion, :integer, :null => false t.column :tipo_participante, :integer, :null => false t.column :participante_id, :integer, :nu...
Ruby
class CreateOrdenSalidaDetalles < ActiveRecord::Migration def self.up create_table :orden_salida_detalles do |t| t.column :orden_salida_id, :integer t.column :producto_id, :integer t.column :cantidad, :integer t.column :costo_unitario, :decimal, :precision => 10, :scale => 2 t.column...
Ruby
class CreatePresupuestoReservas < ActiveRecord::Migration def self.up create_table :presupuesto_reservas do |t| t.column :origen_id, :integer, :default => 0 t.column :destino_id, :integer, :default => 0 t.column :importe, :decimal, :precision => 12, :scale => 2 t.column :created_at, :datet...
Ruby
class AddSoporteMaterialesRechazo < ActiveRecord::Migration def self.up add_column :solicitud_materiales, :motivo_rechazo, :text end def self.down remove_column :solicitud_materiales, :motivo_rechazo end end
Ruby
class CreateBusquedaCorporativos < ActiveRecord::Migration def self.up sql = "CREATE VIEW busqueda_corporativos AS SELECT centros.corporativos.id, centros.corporativos.nombre_comercial, centros.corporativos.razon_social, centros.corporativos.status_id, "+ " centros.corporativos.ejec...
Ruby
class AddPresenciasTipoPatrocinioId < ActiveRecord::Migration def self.up add_column :presencias, :tipo_patrocinio_id, :integer end def self.down remove_column :presencias, :tipo_patrocinio_id end end
Ruby
class ChangeEvaluacionVentas < ActiveRecord::Migration def self.up remove_column :evaluacion_ventas, :venta_copas remove_column :evaluacion_ventas, :venta_botellas # indicar si la venta es de copas (1) o botellas (2) add_column :evaluacion_ventas, :tipo_venta, :integer # la cantidad de c...
Ruby
class AddProductosMarcaId < ActiveRecord::Migration def self.up add_column :productos, :marca_id, :integer add_column :productos, :familia_id, :integer end def self.down remove_column :productos, :marca_id remove_column :productos, :familia_id end end
Ruby
class AddConcursosCentroId < ActiveRecord::Migration def self.up add_column :concursos, :centro_id, :integer end def self.down remove_column :concursos, :centro_id end end
Ruby
class AddPresenciasTipoPresupuesto < ActiveRecord::Migration def self.up # especificar el origen de presupuesto add_column :concursos, :tipo_presupuesto_id, :integer add_column :presencias, :tipo_presupuesto_id, :integer add_column :promociones , :tipo_presupuesto_id, :integer add_column :salida_m...
Ruby
class CreatePuntajeCentroConsumos < ActiveRecord::Migration def self.up create_table :puntaje_centro_consumos do |t| t.column :centro_id, :integer t.column :evaluacion_id, :integer t.column :operacion, :integer t.column :puntos, :integer t.column :created_at, :datetime t.column...
Ruby
class CreateFamilias < ActiveRecord::Migration def self.up create_table :familias do |t| t.column :categoria_id, :integer t.column :empresa_id, :integer t.column :nombre, :string t.column :status_id, :integer t.column :created_at, :datetime t.column :updated_at, :datetime e...
Ruby
class CreatePuntajeMeseros < ActiveRecord::Migration def self.up create_table :puntaje_meseros do |t| t.column :operacion, :integer t.column :puntos, :integer t.column :evaluacion_id, :integer t.column :empleado_id, :integer end add_index :puntaje_meseros, :evaluacion_id a...
Ruby
class CreateConcursos < ActiveRecord::Migration def self.up create_table :concursos do |t| t.column :fecha_inicio, :date, :null => false t.column :fecha_termino, :date, :null => false t.column :status, :integer t.column :nombre, :string, :null => false t...
Ruby
class CreateSalidaMaterialDetalles < ActiveRecord::Migration def self.up create_table :salida_material_detalles do |t| t.column :salida_material_id, :integer t.column :clave, :string t.column :descripcion, :string t.column :cantidad, :integer t.column :precio, :decimal, :precision =>...
Ruby
class AddBonificacionesAplicableA < ActiveRecord::Migration def self.up add_column :bonificaciones, :aplicable_a, :integer, :default => 1 end def self.down remove_column :bonificaciones, :aplicable_a end end
Ruby
class AddExistenciasUnidadMedida < ActiveRecord::Migration def self.up add_column :existencias, :unidad_medida_id, :integer end def self.down remove_column :existencias, :unidad_medida_id end end
Ruby
class CreateRequisicionProductos < ActiveRecord::Migration def self.up create_table :requisicion_productos do |t| t.column :fecha_autorizacion, :datetime t.column :fecha_entrega, :datetime t.column :descripcion, :string t.column :solicitante_id, :integer t.column :autorizador_id, :in...
Ruby
class CreateFacturas < ActiveRecord::Migration def self.up create_table :facturas do |t| t.column :mayorista_id, :integer t.column :fecha_factura, :date t.column :referencia, :string t.column :created_at, :datetime t.column :updated_at, :datetime end end def...
Ruby
class CreateBusquedaConcursos < ActiveRecord::Migration def self.up sql="CREATE VIEW busqueda_concursos AS SELECT centros.concursos.[id], centros.concursos.tipo, centros.concursos.fecha_inicio, "+ "centros.concursos.fecha_termino, centros.concursos.ejecutivo_id,centros.concursos.nombre, centros.concurso...
Ruby
class AddBonificacionFamilia < ActiveRecord::Migration def self.up add_column :bonificaciones, :familia_id, :integer end def self.down remove_column :bonificaciones, :familia_id end end
Ruby
class CreateCompromisos < ActiveRecord::Migration def self.up create_table :compromisos do |t| t.column :descripcion, :text t.column :responsable, :integer, :null => false t.column :importe, :decimal, :null => true end end def self.down drop_table :compromisos end end
Ruby
class AddPresupuestoReservaEjecutivoId < ActiveRecord::Migration def self.up add_column :presupuesto_reservas, :ejecutivo_id, :integer, :default => 0 end def self.down remove_column :presupuesto_reservas, :ejecutivo_id end end
Ruby
class CreateMayoristas < ActiveRecord::Migration def self.up create_table :mayoristas do |t| t.column :nombre, :string end end def self.down drop_table :mayoristas end end
Ruby
class AddSolicitudMaterialesNombre < ActiveRecord::Migration def self.up add_column :solicitud_materiales, :nombre, :string remove_column :solicitud_materiales, :tipo_presupuesto_id end def self.down remove_column :solicitud_materiales, :nombre add_column :solicitud_materiales, :tipo_presupuesto_...
Ruby