Skip to content
Update Database conversion authored by Émilie Pagé-Perron's avatar Émilie Pagé-Perron
...@@ -48,7 +48,6 @@ select revhistories.id, revhistories.object_id, revhistories.new_text from revhi ...@@ -48,7 +48,6 @@ select revhistories.id, revhistories.object_id, revhistories.new_text from revhi
Update inscriptions with fulltrans data Update inscriptions with fulltrans data
```sql ```sql
update cdli_db.inscriptions update cdli_db.inscriptions
join cdli_db_old.fulltrans on cdli_db_old.fulltrans.object_id = cdli_db.inscriptions.artifact_id join cdli_db_old.fulltrans on cdli_db_old.fulltrans.object_id = cdli_db.inscriptions.artifact_id
...@@ -62,7 +61,20 @@ and ...@@ -62,7 +61,20 @@ and
cdli_db_old.fulltrans.wholetext = cdli_db.inscriptions.atf cdli_db_old.fulltrans.wholetext = cdli_db.inscriptions.atf
``` ```
update is_latest
```sql
update cdli_db.inscriptions
join cdli_db_old.revhistories on
cdli_db_old.revhistories.id = cdli_db.inscriptions.id
set cdli_db.inscriptions.is_latest = 1
where
cdli_db.inscriptions.id = (SELECT t1.id
FROM cdli_db_old.revhistories t1
WHERE t1.mod_date = (SELECT MAX(t2.mod_date)
FROM cdli_db_old.revhistories t2
WHERE t2.object_id = t1.object_id));
```
Prepare or update tmp author and credits table: Prepare or update tmp author and credits table:
... ...
......