passo_mobile_app/lib/utils/sql_helper.dart

59 lines
1.7 KiB
Dart
Raw Permalink Normal View History

import 'package:sqflite/sqflite.dart' as sql;
import 'package:sqflite/sqflite.dart';
Future _createDB(Database db, int version) async {
// const idType = 'INTEGER PRIMARY KEY AUTOINCREMENT';
// const textType = 'TEXT NOT NULL';
// const boolType = 'BOOLEAN NOT NULL';
// const integerType = 'INTEGER NOT NULL';
await db.execute('''
CREATE TABLE items (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
transCode TEXT NOT NULL,
tdn TEXT NOT NULL,
pin TEXT NOT NULL,
owner TEXT NOT NULL,
address TEXT NOT NULL,
telno TEXT NOT NULL,
tin TEXT NOT NULL,
adminUser TEXT NOT NULL,
adminAddress TEXT NOT NULL,
adminTelno TEXT NOT NULL,
adminTin TEXT NOT NULL,
faasType TEXT NOT NULL,
assessedById TEXT NOT NULL,
assessedByName TEXT NOT NULL
)
''');
await db.execute('''
CREATE TABLE landref (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
bldgapprDetailsId INTEGER NOT NULL,
assessedById TEXT NOT NULL,
assessedByName TEXT NOT NULL,
owner TEXT NOT NULL,
cloaNo TEXT NOT NULL,
lotNo TEXT NOT NULL,
tdn TEXT NOT NULL,
area TEXT NOT NULL,
surveyNo TEXT NOT NULL,
blkNo TEXT NOT NULL
)
''');
await db.execute('''
CREATE TABLE location (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
bldgapprDetailsId INTEGER NOT NULL,
assessedById TEXT NOT NULL,
assessedByName TEXT NOT NULL,
street TEXT NOT NULL,
barangay TEXT NOT NULL,
municipality TEXT NOT NULL,
province TEXT NOT NULL
)
''');
}