Bien... mi problema es con una tabla ke uso para manipular players, experiencia, casas, guilds etc... en un Server de un juego Rpg online.
Ovbiamente, la tabla no la cree yo... viene digamos "limpia" con el server ke descargo.
Tengo este error:
[02/12/2008 23:41:32] OTS_SQLITE3_PREPARE(): SQLITE ERROR: table houses has no column named name
y por ese error, no se guardan los dueños de las casas, y cuando loguean y vuelven a entrar al juego, pierden sus casas =/
Uso Sqlite expert para manipularla
en una tabla llamada House_lists hay una pestaña llamada "DDl" dond tengo esto:
Cita:
en una tabla llamada "houses" tengo esto en la pestaña "DDL"CREATE TABLE "house_lists" (
"house_id" INTEGER NOT NULL,
"listid" INTEGER NOT NULL,
"list" TEXT NOT NULL,
FOREIGN KEY ("house_id") REFERENCES "houses" ("id")
);
CREATE TRIGGER "oninsert_house_lists"
BEFORE INSERT
ON "house_lists"
FOR EACH ROW
BEGIN
SELECT RAISE(ROLLBACK, 'INSERT on table "house_lists" violates foreign: "house_id"')
WHERE NEW."house_id" IS NULL
OR (SELECT "id" FROM "houses" WHERE "id" = NEW."house_id") IS NULL;
END;
CREATE TRIGGER "onupdate_house_lists"
BEFORE UPDATE
ON "house_lists"
FOR EACH ROW
BEGIN
SELECT RAISE(ROLLBACK, 'UPDATE on table "house_lists" violates foreign: "house_id"')
WHERE NEW."house_id" IS NULL
OR (SELECT "id" FROM "houses" WHERE "id" = NEW."house_id") IS NULL;
END;
"house_id" INTEGER NOT NULL,
"listid" INTEGER NOT NULL,
"list" TEXT NOT NULL,
FOREIGN KEY ("house_id") REFERENCES "houses" ("id")
);
CREATE TRIGGER "oninsert_house_lists"
BEFORE INSERT
ON "house_lists"
FOR EACH ROW
BEGIN
SELECT RAISE(ROLLBACK, 'INSERT on table "house_lists" violates foreign: "house_id"')
WHERE NEW."house_id" IS NULL
OR (SELECT "id" FROM "houses" WHERE "id" = NEW."house_id") IS NULL;
END;
CREATE TRIGGER "onupdate_house_lists"
BEFORE UPDATE
ON "house_lists"
FOR EACH ROW
BEGIN
SELECT RAISE(ROLLBACK, 'UPDATE on table "house_lists" violates foreign: "house_id"')
WHERE NEW."house_id" IS NULL
OR (SELECT "id" FROM "houses" WHERE "id" = NEW."house_id") IS NULL;
END;
Cita:
Aki dejo el link donde subi un archivo llamado schema.sqlite supongo serviraCREATE TABLE "houses" (
"id" INTEGER PRIMARY KEY,
"owner" INTEGER NOT NULL,
"paid" INTEGER NOT NULL DEFAULT 0,
"warnings" INTEGER NOT NULL DEFAULT 0,
"lastwarning" INTEGER NOT NULL DEFAULT 0
, "size" INTEGER NOT NULL DEFAULT 0, "town" INTEGER NOT NULL DEFAULT 0, "price" INTEGER NOT NULL DEFAULT 0, "rent" INTEGER NOT NULL DEFAULT 0);
CREATE TRIGGER "ondelete_houses"
BEFORE DELETE
ON "houses"
FOR EACH ROW
BEGIN
DELETE FROM "house_lists" WHERE "house_id" = OLD."id";
END;
"id" INTEGER PRIMARY KEY,
"owner" INTEGER NOT NULL,
"paid" INTEGER NOT NULL DEFAULT 0,
"warnings" INTEGER NOT NULL DEFAULT 0,
"lastwarning" INTEGER NOT NULL DEFAULT 0
, "size" INTEGER NOT NULL DEFAULT 0, "town" INTEGER NOT NULL DEFAULT 0, "price" INTEGER NOT NULL DEFAULT 0, "rent" INTEGER NOT NULL DEFAULT 0);
CREATE TRIGGER "ondelete_houses"
BEFORE DELETE
ON "houses"
FOR EACH ROW
BEGIN
DELETE FROM "house_lists" WHERE "house_id" = OLD."id";
END;
http://www.gigasize.com/get.php?d=wtvfw8ogztf
Agradezco de ante mano la ayuda!!
Saludos.