I already made connections with MYSQL but now i want to make connections in sqlite cause now i’m in a project with friends and we are using dropbox, i remade a database structure from MYSQL to sqlite in a new page i made just for test… the MYSQL version works, but the sqlite version doesn’t work.
This is the structure on sqlite:
DROP TABLE IF EXISTS "comment";
CREATE TABLE "comment" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "Content" TEXT NOT NULL , "Status" INTEGER NOT NULL , "Create_time" VARCHAR(45), "Author" INTEGER NOT NULL , "Task_id" INTEGER NOT NULL );
DROP TABLE IF EXISTS "project";
CREATE TABLE "project" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "Name" VARCHAR(45) NOT NULL , "Description" TEXT);
DROP TABLE IF EXISTS "tags";
CREATE TABLE "tags" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "Name" VARCHAR(128) NOT NULL , "Frequency" INTEGER);
DROP TABLE IF EXISTS "task";
CREATE TABLE "task" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "Name" VARCHAR(45) NOT NULL , "Description" TEXT, "Status" INTEGER NOT NULL , "Create_time" VARCHAR(45), "Update_time" VARCHAR(45), "Tags" TEXT, "Assigned" VARCHAR(45), "Project_id" INTEGER NOT NULL , "User_id" INTEGER NOT NULL );
DROP TABLE IF EXISTS "user";
CREATE TABLE "user" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "username" VARCHAR(128) NOT NULL , "password" VARCHAR(128) NOT NULL , "email" VARCHAR(128) NOT NULL , "session" TEXT);
the name of this structure is Organizer.sql and i made the command in sqlite sqlite3 Organizer.db < Organizer.sql
just in case this is the config:
<?php
// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');
// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
'name'=>'Organizer',
// preloading 'log' component
'preload'=>array('log'),
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
'modules'=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'3141',
// If removed, Gii defaults to localhost only. Edit carefully to taste.
'ipFilters'=>array('127.0.0.1','::1', '192.168.0', '192.168.1'),
),
),
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
'loginUrl'=>array('site/login')
),
// uncomment the following to enable URLs in path-format
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'urlSuffix'=>'.php',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
'db'=>array(
'connectionString'=>'sqlite:protected/data/Organizer.db',
),
/*
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=organizer',
'emulatePrepare' => true,
'username' => 'root',
'password' => '3141',
'charset' => 'utf8',
),
*/
'errorHandler'=>array(
// use 'site/error' action to display errors
'errorAction'=>'site/error',
),
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CFileLogRoute',
'levels'=>'error, warning',
),
// uncomment the following to show log messages on web pages
// array(
// 'class'=>'CWebLogRoute',
// ),
),
),
),
// application-level parameters that can be accessed
// using Yii::app()->params['paramName']
'params'=>array(
// this is used in contact page
'adminEmail'=>'webmaster@example.com',
),
);
but only when i get into the index of the page… i get The table "project" for active record class "Project" cannot be found in the database.