Skip to content

Instantly share code, notes, and snippets.

@zemagno
Created December 9, 2016 21:23
Show Gist options
  • Save zemagno/775bb6ab0722a55d580fb85069ebb41a to your computer and use it in GitHub Desktop.
Save zemagno/775bb6ab0722a55d580fb85069ebb41a to your computer and use it in GitHub Desktop.
class CreateFuncionarios < ActiveRecord::Migration
def change
create_table :funcionarios, id: false do |t|
t.string :Login, :limit => 30, primary_key: true
t.integer :Matricula
t.string :Nome
t.date :DataAdmissao
t.date :DataDemissao
t.string :Email
t.string :CPF, :limit => 20
t.string :Identidade, :limit => 20
t.string :CodigoCC , :limit => 6
t.string :NomeCC
t.string :NomeTipoCC
t.string :OwnerCC
t.string :CodigoSecao, :limit => 10
t.string :NomeLocalTrabalho
t.string :NomeCidadeTrabalho
t.string :CCTorre, :limit => 6
t.string :DescCCTorre
end
end
end
create_table "funcionarios", primary_key: "Login", force: :cascade do |t|
t.integer "NumMatrProfissional", limit: 4
t.string "NomProfissional", limit: 50
t.date "DtaAdmissao"
t.date "DtaDemissao"
t.string "NomEmailBRQ", limit: 50
t.string "IdtCPF", limit: 20
t.string "IdtRG", limit: 20
t.string "IdtCodigoCentroCusto", limit: 10
t.string "NomCentroCusto", limit: 255
t.string "NomTipoCentroCusto", limit: 255
t.string "IdtCodigoSecao", limit: 10
t.string "NomLocalTrabalho", limit: 50
t.string "NomCidadeLocalTrabalho", limit: 50
t.string "IdtCentroCustoTorre", limit: 10
....
mysql> describe itmgmt_new.funcionarios;
+------------------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------------------+--------------+------+-----+---------+----------------+
| Login | int(11) | NO | PRI | NULL | auto_increment |
mysql> describe itmgmt_new.funcionarios;
+------------------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------------------+--------------+------+-----+---------+-------+
| Login | varchar(30) | NO | PRI | | |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment