I am rather anxious today. I think it has to do with the medication(s) I am on at the moment. Doctor changed some medications, added some, did some other things put me back on medications I haven’t been on in a while…the same ol’ same ol’. Anti-Psychotic meds work wonders when they work, they’re amazing. When your mind doesn’t want them to work? Well, that’s when things become quite a problem. I hate to admit it, but life doesn’t always work the way we want it to work. What can I say? It’s a mess at times. There’s nothing wrong with that, but to say it’s not complex is a complete overhaul of whatever there is. Talk about a mixed bag of nuts. Someone doesn’t understand everything there is to understand about it all. If I wasn’t anxious, today would be a better day than it is. But, well I am so there’s nothing I can do about it. I wish there was…but there isn’t so I’ll just have to deal with whatever comes my way. Such a bummer if you think about it all. Nothing is ever cureable. Every...
Here's some code I'm working on for a sqlite3 database to store backup file content. Might add a BLOB type later for storing binary data. Not sure yet.
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE files (id INTEGER PRIMARY KEY,
name TEXT,
content TEXT,
created_ts TEXT,
modified_ts TEXT);
CREATE TABLE files_log(id INTEGER PRIMARY KEY,
fileid TEXT,
name TEXT,
content TEXT,
created_ts TEXT,
modified_ts TEXT,
dt TEXT);
CREATE TRIGGER files_trig AFTER INSERT ON files
BEGIN
update files SET created_ts = datetime('now','localtime') WHERE id = NEW.id;
END;
CREATE TRIGGER files_update_trig AFTER UPDATE ON files
BEGIN
update files SET modified_ts = datetime('now','localtime') WHERE id = OLD.id;
insert into files_log(fileid, name, content, created_ts, modified_ts)
values(OLD.id, OLD.name, OLD.content, OLD.created_ts, OLD.modified_ts);
END;
CREATE TRIGGER files_log_update_trig AFTER INSERT ON files_log
BEGIN
update files_log SET dt = datetime('now', 'localtime') WHERE id = NEW.id;
END;
COMMIT;
Comments
Post a Comment