Add mysql2sqlite submodule and script for making a sqlite database out of the mysql dumps. This will be used to create html archives of the forum.

This commit is contained in:
Adrian Kuschelyagi Malacoda 2020-08-09 04:01:19 -05:00
parent 51e9782c7e
commit 7026bc2b34
4 changed files with 18 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "mysql2sqlite"]
path = mysql2sqlite
url = https://github.com/dumblob/mysql2sqlite.git

14
forum/create_sqlite_database Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
SQLITE_OUT=forum.sqlite
AWK=awk
if command -v mawk &> /dev/null; then
AWK=mawk
fi
$AWK -f ../mysql2sqlite/mysql2sqlite structure.sql | sqlite3 -echo $SQLITE_OUT
$AWK -f ../mysql2sqlite/mysql2sqlite misc_data.sql | sqlite3 -echo $SQLITE_OUT
$AWK -f ../mysql2sqlite/mysql2sqlite categories.sql | sqlite3 -echo $SQLITE_OUT
$AWK -f ../mysql2sqlite/mysql2sqlite boards.sql | sqlite3 -echo $SQLITE_OUT
$AWK -f ../mysql2sqlite/mysql2sqlite threads.sql | sqlite3 -echo $SQLITE_OUT
#cat threads.sql | sqlite3 $SQLITE_OUT

1
mysql2sqlite Submodule

@ -0,0 +1 @@
Subproject commit 2a759df79092f42893bff593beb685a2dc0a9607