Proyectos de Subversion Iphone Microlearning - Inconcert

Rev

Rev 1 | Rev 15 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 14
Línea 134... Línea 134...
134
        
134
        
135
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
135
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 136... Línea 136...
136
            if sqlite3_step(statement) == SQLITE_DONE {
136
            if sqlite3_step(statement) == SQLITE_DONE {
137
                
137
                
Línea 138... Línea 138...
138
                let queries = [
138
                let queries = [
Línea 139... Línea 139...
139
                    "CREATE INDEX `idx_app_id` ON `" +  Constants.TABLE_APP + "` (`" +  Constants.TABLE_APP_FIELD_ID + "` );",
139
                    "CREATE INDEX IF NOT EXISTS `idx_app_id` ON `" +  Constants.TABLE_APP + "` (`" +  Constants.TABLE_APP_FIELD_ID + "` );",
140
                
140
                
Línea 141... Línea 141...
141
                    "CREATE INDEX `idx_app_user_uuid` ON `" +  Constants.TABLE_APP + "` (`" +  Constants.TABLE_APP_FIELD_USER_UUID + "` );",
141
                    "CREATE INDEX IF NOT EXISTS `idx_app_user_uuid` ON `" +  Constants.TABLE_APP + "` (`" +  Constants.TABLE_APP_FIELD_USER_UUID + "` );",
Línea 180... Línea 180...
180
        
180
        
181
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
181
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 182... Línea 182...
182
            if sqlite3_step(statement) == SQLITE_DONE {
182
            if sqlite3_step(statement) == SQLITE_DONE {
183
                
183
                
Línea 184... Línea 184...
184
                let queries = [
184
                let queries = [
185
                    "CREATE INDEX `idx_user_unotification_id` ON `" +  Constants.TABLE_USER_NOTIFICATION + "` (`" +  Constants.TABLE_USER_NOTIFICATION_FIELD_ID + "` );",
185
                    "CREATE INDEX IF NOT EXISTS `idx_user_unotification_id` ON `" +  Constants.TABLE_USER_NOTIFICATION + "` (`" +  Constants.TABLE_USER_NOTIFICATION_FIELD_ID + "` );",
Línea 186... Línea 186...
186
                
186
                
Línea 187... Línea 187...
187
                    "CREATE INDEX `idx_user_notification_user_uuid` ON `" +  Constants.TABLE_USER_NOTIFICATION + "` (`" +  Constants.TABLE_USER_NOTIFICATION_FIELD_USER_UUID + "` );"
187
                    "CREATE INDEX IF NOT EXISTS `idx_user_notification_user_uuid` ON `" +  Constants.TABLE_USER_NOTIFICATION + "` (`" +  Constants.TABLE_USER_NOTIFICATION_FIELD_USER_UUID + "` );"
Línea 214... Línea 214...
214
        
214
        
215
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
215
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 216... Línea 216...
216
            if sqlite3_step(statement) == SQLITE_DONE {
216
            if sqlite3_step(statement) == SQLITE_DONE {
217
                
217
                
218
                let queries = [
218
                let queries = [
Línea 219... Línea 219...
219
                    "CREATE INDEX `idx_user_extended_company_uuid` ON `" +  Constants.TABLE_USER_EXTENDED + "` (`" +  Constants.TABLE_USER_EXTENDED_FIELD_COMPANY_UUID + "` );"
219
                    "CREATE INDEX IF NOT EXISTS  `idx_user_extended_company_uuid` ON `" +  Constants.TABLE_USER_EXTENDED + "` (`" +  Constants.TABLE_USER_EXTENDED_FIELD_COMPANY_UUID + "` );"
Línea 220... Línea 220...
220
                ]
220
                ]
Línea 267... Línea 267...
267
        
267
        
268
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
268
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 269... Línea 269...
269
            if sqlite3_step(statement) == SQLITE_DONE {
269
            if sqlite3_step(statement) == SQLITE_DONE {
270
                
270
                
271
                let queries = [
271
                let queries = [
Línea 272... Línea 272...
272
                    "CREATE INDEX `idx_company_company_uuid` ON `" +  Constants.TABLE_COMPANY + "` (`" +  Constants.TABLE_COMPANY_FIELD_UUID + "` );"
272
                    "CREATE INDEX IF NOT EXISTS `idx_company_company_uuid` ON `" +  Constants.TABLE_COMPANY + "` (`" +  Constants.TABLE_COMPANY_FIELD_UUID + "` );"
Línea 273... Línea 273...
273
                ]
273
                ]
Línea 304... Línea 304...
304
        
304
        
305
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
305
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 306... Línea 306...
306
            if sqlite3_step(statement) == SQLITE_DONE {
306
            if sqlite3_step(statement) == SQLITE_DONE {
307
                
307
                
308
                let queries = [
308
                let queries = [
Línea 309... Línea 309...
309
                    "CREATE INDEX `idx_topics_company_uuid` ON `" +  Constants.TABLE_TOPIC + "` (`" +  Constants.TABLE_TOPIC_FIELD_COMPANY_UUID + "` );"
309
                    "CREATE INDEX IF NOT EXISTS  `idx_topics_company_uuid` ON `" +  Constants.TABLE_TOPIC + "` (`" +  Constants.TABLE_TOPIC_FIELD_COMPANY_UUID + "` );"
Línea 310... Línea 310...
310
                ]
310
                ]
Línea 346... Línea 346...
346
        
346
        
347
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
347
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 348... Línea 348...
348
            if sqlite3_step(statement) == SQLITE_DONE {
348
            if sqlite3_step(statement) == SQLITE_DONE {
349
                
349
                
Línea 350... Línea 350...
350
                let queries = [
350
                let queries = [
Línea 351... Línea 351...
351
                    "CREATE INDEX `idx_capsules_topic_uuid` ON `" +  Constants.TABLE_CAPSULE + "` (`" +  Constants.TABLE_CAPSULE_FIELD_TOPIC_UUID + "` );"
351
                    "CREATE INDEX IF NOT EXISTS `idx_capsules_topic_uuid` ON `" +  Constants.TABLE_CAPSULE + "` (`" +  Constants.TABLE_CAPSULE_FIELD_TOPIC_UUID + "` );"
Línea 387... Línea 387...
387
        
387
        
388
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
388
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 389... Línea 389...
389
            if sqlite3_step(statement) == SQLITE_DONE {
389
            if sqlite3_step(statement) == SQLITE_DONE {
390
                
390
                
Línea 391... Línea 391...
391
                let queries = [
391
                let queries = [
Línea 392... Línea 392...
392
                    "CREATE INDEX `idx_slides_quiz_uuid` ON `" +  Constants.TABLE_SLIDE + "` (`" +  Constants.TABLE_SLIDE_FIELD_QUIZ_UUID + "` );",
392
                    "CREATE INDEX IF NOT EXISTS `idx_slides_quiz_uuid` ON `" +  Constants.TABLE_SLIDE + "` (`" +  Constants.TABLE_SLIDE_FIELD_QUIZ_UUID + "` );",
Línea 393... Línea 393...
393
                
393
                
Línea 394... Línea 394...
394
                    "CREATE INDEX `idx_slides_capsule_uuid` ON `" +  Constants.TABLE_SLIDE + "` (`" +  Constants.TABLE_SLIDE_FIELD_CAPSULE_UUID + "` );",
394
                    "CREATE INDEX IF NOT EXISTS  `idx_slides_capsule_uuid` ON `" +  Constants.TABLE_SLIDE + "` (`" +  Constants.TABLE_SLIDE_FIELD_CAPSULE_UUID + "` );",
Línea 438... Línea 438...
438
        
438
        
439
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
439
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 440... Línea 440...
440
            if sqlite3_step(statement) == SQLITE_DONE {
440
            if sqlite3_step(statement) == SQLITE_DONE {
441
                
441
                
Línea 442... Línea 442...
442
                let queries = [
442
                let queries = [
Línea 443... Línea 443...
443
                    "CREATE INDEX `idx_progress_topic_uuid` ON `" +  Constants.TABLE_PROGRESS + "` (`" +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + "` );",
443
                    "CREATE INDEX IF NOT EXISTS `idx_progress_topic_uuid` ON `" +  Constants.TABLE_PROGRESS + "` (`" +  Constants.TABLE_PROGRESS_FIELD_TOPIC_UUID + "` );",
Línea 444... Línea 444...
444
                
444
                
445
                    "CREATE INDEX `idx_progress_capsule_uuid` ON `" +  Constants.TABLE_PROGRESS + "` (`" +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_UUID + "` );",
445
                    "CREATE INDEX IF NOT EXISTS  `idx_progress_capsule_uuid` ON `" +  Constants.TABLE_PROGRESS + "` (`" +  Constants.TABLE_PROGRESS_FIELD_CAPSULE_UUID + "` );",
Línea 446... Línea 446...
446
                
446
                
Línea 447... Línea 447...
447
                    "CREATE INDEX `idx_progress_slide_uuid` ON `" +  Constants.TABLE_PROGRESS + "` (`" +  Constants.TABLE_PROGRESS_FIELD_SLIDE_UUID + "` );",
447
                    "CREATE INDEX IF NOT EXISTS  `idx_progress_slide_uuid` ON `" +  Constants.TABLE_PROGRESS + "` (`" +  Constants.TABLE_PROGRESS_FIELD_SLIDE_UUID + "` );",
Línea 480... Línea 480...
480
        
480
        
481
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
481
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 482... Línea 482...
482
            if sqlite3_step(statement) == SQLITE_DONE {
482
            if sqlite3_step(statement) == SQLITE_DONE {
483
                
483
                
Línea 484... Línea 484...
484
                let queries = [
484
                let queries = [
485
                    "CREATE INDEX `idx_user_log_user_uuid` ON `" +  Constants.TABLE_USER_LOG + "` (`" +  Constants.TABLE_USER_LOG_FIELD_USER_UUID + "` );",
485
                    "CREATE INDEX IF NOT EXISTS `idx_user_log_user_uuid` ON `" +  Constants.TABLE_USER_LOG + "` (`" +  Constants.TABLE_USER_LOG_FIELD_USER_UUID + "` );",
Línea 486... Línea 486...
486
                    
486
                    
Línea 487... Línea 487...
487
                    "CREATE INDEX `idx_user_log_added_on` ON `" +  Constants.TABLE_USER_LOG + "` (`" +  Constants.TABLE_USER_LOG_FIELD_ADDED_ON + "` );"
487
                    "CREATE INDEX IF NOT EXISTS `idx_user_log_added_on` ON `" +  Constants.TABLE_USER_LOG + "` (`" +  Constants.TABLE_USER_LOG_FIELD_ADDED_ON + "` );"
Línea 521... Línea 521...
521
        
521
        
522
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
522
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 523... Línea 523...
523
            if sqlite3_step(statement) == SQLITE_DONE {
523
            if sqlite3_step(statement) == SQLITE_DONE {
524
                
524
                
525
                let queries = [
525
                let queries = [
Línea 526... Línea 526...
526
                    "CREATE INDEX `idx_quizzes_company_uuid` ON `" +  Constants.TABLE_QUIZ + "` (`" +  Constants.TABLE_QUIZ_FIELD_COMPANY_UUID + "` );"
526
                    "CREATE INDEX IF NOT EXISTS  `idx_quizzes_company_uuid` ON `" +  Constants.TABLE_QUIZ + "` (`" +  Constants.TABLE_QUIZ_FIELD_COMPANY_UUID + "` );"
Línea 527... Línea 527...
527
                ]
527
                ]
Línea 556... Línea 556...
556
        
556
        
557
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
557
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
Línea 558... Línea 558...
558
            if sqlite3_step(statement) == SQLITE_DONE {
558
            if sqlite3_step(statement) == SQLITE_DONE {
559
            
559
            
560
                let queries = [
560
                let queries = [
Línea 561... Línea 561...
561
                    "CREATE INDEX `idx_questions_quiz_uuid` ON " +  Constants.TABLE_QUIZ + "` (`" +  Constants.TABLE_QUIZ_FIELD_UUID + "` );"
561
                    "CREATE INDEX IF NOT EXISTS `idx_questions_quiz_uuid` ON " +  Constants.TABLE_QUIZ + "` (`" +  Constants.TABLE_QUIZ_FIELD_UUID + "` );"
562
                ]
562
                ]
563
                
563
                
Línea 588... Línea 588...
588
        var statement : OpaquePointer? = nil
588
        var statement : OpaquePointer? = nil
Línea 589... Línea 589...
589
        
589
        
590
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
590
        if sqlite3_prepare_v2(self.conn, sql, -1, &statement, nil) == SQLITE_OK {
591
            if sqlite3_step(statement) == SQLITE_DONE {
591
            if sqlite3_step(statement) == SQLITE_DONE {
592
                let queries = [
592
                let queries = [
593
                    "CREATE INDEX `idx_answers_question_uuid` ON `" +  Constants.TABLE_QUESTION + "` (`" +  Constants.TABLE_QUESTION_FIELD_UUID + "` );"
593
                    "CREATE INDEX IF NOT EXISTS `idx_answers_question_uuid` ON `" +  Constants.TABLE_QUESTION + "` (`" +  Constants.TABLE_QUESTION_FIELD_UUID + "` );"
Línea 594... Línea 594...
594
                ]
594
                ]
Línea 595... Línea 595...
595
                
595