aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v2/db_remove.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-04-16 10:12:46 -0400
committerRalph Amissah <ralph@amissah.com>2010-04-16 10:15:13 -0400
commitaa47d1db8596aa65746db05d369441d1def62aa4 (patch)
treec1f1ab145389abd7e30b083f05e6adbcfcfc4dbe /lib/sisu/v2/db_remove.rb
parentdb, shared_html_lite, link back to footnote/endnote reference, fix (diff)
db sql table and column structure changes, name prefix "sisu_v2a_" resulting sisu version bump 2.1.0, plus other lesser fixes
[Note: it is necessary to create new database and tables and to populate them] * db (sql) database table name and column structure changes, new pgsql db name prefix "sisu_v2a_" (version bump), continue to review (db_columns, db_create, db_import, db_sqltxt) * db remove and update fix, match filename for removal with = (not LIKE or ~) * db sqlite, issue with --recreate, bugfix (db_drop)
Diffstat (limited to 'lib/sisu/v2/db_remove.rb')
-rw-r--r--lib/sisu/v2/db_remove.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sisu/v2/db_remove.rb b/lib/sisu/v2/db_remove.rb
index 99640cdf..0a51b892 100644
--- a/lib/sisu/v2/db_remove.rb
+++ b/lib/sisu/v2/db_remove.rb
@@ -68,19 +68,19 @@ module SiSU_DB_remove
def remove
driver_sqlite3=(@conn.inspect.match(/^(.{10})/)[1]==@db.sqlite.conn_sqlite3.inspect.match(/^(.{10})/)[1]) ? true : false
del_id=if driver_sqlite3
- @conn.get_first_value(%{ SELECT tid FROM metadata WHERE filename LIKE '#{@opt.fns}'; }).to_i
+ @conn.get_first_value(%{ SELECT tid FROM metadata_and_text WHERE filename = '#{@opt.fns}'; }).to_i
else
- x=@conn.select_one(%{ SELECT tid FROM metadata WHERE filename LIKE '#{@opt.fns}'; })
- del=x ? (x.join.to_i) : nil
+ x=@conn.select_one(%{ SELECT metadata_and_text.tid FROM metadata_and_text WHERE metadata_and_text.filename = '#{@opt.fns}'; })
+ x ? (x.join.to_i) : nil
end
if del_id
sql_entry=[
"DELETE FROM endnotes WHERE metadata_tid = '#{del_id}';",
"DELETE FROM endnotes_asterisk WHERE metadata_tid = '#{del_id}';",
"DELETE FROM endnotes_plus WHERE metadata_tid = '#{del_id}';",
- "DELETE FROM documents WHERE metadata_tid = '#{del_id}';",
+ "DELETE FROM doc_objects WHERE metadata_tid = '#{del_id}';",
"DELETE FROM urls WHERE metadata_tid = '#{del_id}';",
- "DELETE FROM metadata WHERE tid = '#{del_id}';",
+ "DELETE FROM metadata_and_text WHERE metadata_and_text.tid = '#{del_id}';",
]
if driver_sqlite3
@conn.transaction