--Meus amigos, tenho o seguinte script para montar as tabelas:
// CRIA A TABELA CLIENTES
private static final String DATABASE_CREATE_CLIENTES = "create table clientes (id_Cliente integer primary key autoincrement, nome text, data text, telefone text, celular text, email text);";
// CRIA A TABELA CARROS
private static final String DATABASE_CREATE_CARROS = "create table veiculos (id_Veiculo integer primary key autoincrement,
idCliente integer, idTipoVeiculo integer, modelo text, placa text, FOREIGN KEY (idCliente) REFERENCES clientes(idCliente), FOREIGN KEY (id_TipoVeiculo) REFERENCES tipo_veiculo (id_TipoVeiculo));";
// CRIA A TABELA TIPO_VEÍCULO
private static final String DATABASE_CREATE_TIPO_VEICULO = "create table tipo_veiculo (id_TipoVeiculo integer primary key autoincrement, descricao_tipo text));";
// CRIA A TABELA SERVICOS
private static final String DATABASE_CREATE_SERVICOS = "create table servicos (id_Servico integer primary key autoincrement, id_TipoVeiculo integer, descricao_ser text, valor text, FOREIGN KEY (id_TipoVeiculo) REFERENCES tipo_veiculo (id_TipoVeiculo));";
// CRIA A TABELA HORARIOS
private static final String DATABASE_CREATE_HORARIOS = "create table horarios (id_Horario integer primary key autoincrement, horario text);";
// CRIA A TABELA OS
private static final String DATABASE_CREATE_OS = "create table os (id_Os integer primary key autoincrement, id_Cliente integer,
id_Servico integer, id_Horario integer , modelo text, placa text, mecanico text, data text, FOREIGN KEY (id_Cliente) REFERENCES clientes (id_Cliente), FOREIGN KEY (id_Servico) REFERENCES servicos (id_Servico), FOREIGN KEY (id_Horario) REFERENCES horarios (id_Horario));";
db.execSQL(sqlClientes);
db.execSQL(sqlOutraTabela);
Qual o melhor método para criar as tabelas e o banco usando esse script ou StringBuilder?
Att,
Frederico Brigatte
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.






0 comentários:
Postar um comentário