Browse Source

crm stage local database design ok

robert2206 8 years ago
parent
commit
e8c385e7b5
2 changed files with 12 additions and 0 deletions
  1. 1 0
      www/index.html
  2. 11 0
      www/js/app.js

+ 1 - 0
www/index.html

@@ -41,6 +41,7 @@
     <script src="js/factories/sales/customer.sync.factory.js"></script>
     <script src="js/factories/sales/lead.storage.factory.js"></script>
     <script src="js/factories/sales/lead.sync.factory.js"></script>
+    <script src="js/factories/sales/crm.stage.storage.factory.js"></script>
     <script src="js/factories/sales/opportunity.storage.factory.js"></script>
     <script src="js/factories/sales/opportunity.sync.factory.js"></script>
 

+ 11 - 0
www/js/app.js

@@ -27,6 +27,7 @@ angular.module(
         }
 
         db = window.sqlitePlugin.openDatabase({ name: 'odoo.db', location: 'default' });
+         
         db.executeSql("CREATE TABLE IF NOT EXISTS 'user' (\n\
                        'id' INTEGER NOT NULL  PRIMARY KEY AUTOINCREMENT,\n\
                        'remote_id' INTEGER DEFAULT 0,\n\
@@ -35,6 +36,7 @@ angular.module(
                        'database' VARCHAR(35) DEFAULT NULL,\n\
                        'username' VARCHAR(35) DEFAULT NULL,\n\
                        'password' VARCHAR(35) DEFAULT NULL)");
+         
         db.executeSql("CREATE TABLE IF NOT EXISTS 'partner' (\n\
                        'id' INTEGER DEFAULT NULL PRIMARY KEY AUTOINCREMENT,\n\
                        'remote_id' INTEGER DEFAULT 0,\n\
@@ -86,6 +88,15 @@ angular.module(
                       'type' VARCHAR(20) DEFAULT NULL,\n\
                       'user_id' INTEGER DEFAULT 0,\n\
                       'partner_id' INTEGER DEFAULT 0);");
+         
+        db.executeSql("CREATE TABLE IF NOT EXISTS 'crm_stage' (\n\
+                      'id' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,\n\
+                      'remote_id' INTEGER DEFAULT 0,\n\
+                      'modified' INTEGER DEFAULT 0,\n\
+                      'modified_date' TEXT DEFAULT CURRENT_TIMESTAMP,\n\
+                      'name' VARCHAR(35) DEFAULT NULL,\n\
+                      'probability' REAL DEFAULT 0,\n\
+                      'type' VARCHAR(100) DEFAULT 'both');");
 
         configFactory(function (configuration) {
             if (configuration) {