Created
November 27, 2015 03:25
-
-
Save rafaelwms/8da3c71b3ee7d1f3aa1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.rafaelwms.kiss.sqlite; | |
import android.content.Context; | |
import android.database.sqlite.SQLiteDatabase; | |
import android.database.sqlite.SQLiteOpenHelper; | |
/** | |
* Created by Rafael on 26/11/2015. | |
*/ | |
public class KissDBHelper extends SQLiteOpenHelper { | |
public KissDBHelper(Context ctx) { | |
super(ctx, "KeepItSafeSecure", null, 1); | |
} | |
@Override | |
public void onCreate(SQLiteDatabase db) { | |
// TODO Remover as tabelas quando o sistema esteja completamente WEB | |
db.execSQL( "CREATE TABLE SERVICOS (" + | |
"idServico INTEGER PRIMARY KEY AUTOINCREMENT, " + | |
"nomeServico TEXT NOT NULL UNIQUE, " + | |
"icoServico INTEGER NOT NULL, " + | |
"usaServidor INTEGER NOT NULL," + | |
"usaPorta INTEGER NOT NULL);"); | |
db.execSQL( "CREATE TABLE CONTAS (" + | |
"idConta INTEGER PRIMARY KEY AUTOINCREMENT, " + | |
"idServico INTEGER NOT NULL REFERENCES SERVICO(idServico) ON DELETE CASCADE, " + | |
"login TEXT NOT NULL, " + | |
"senha TEXT NOT NULL, " + | |
"servidor TEXT NULL, " + | |
"porta INTEGER NULL);"); | |
} | |
@Override | |
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { | |
// TODO Auto-generated method stub | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment