blob: f954f923082debe09f159d7fb1e9f47b0fec1ea4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/sh
cat $1 | \
grep -v ^# | \
grep -v ' KEY "' | \
grep -v ' UNIQUE KEY "' | \
sed -e "s/\`/\'/g" -e "s/UNIX_TIMESTAMP()/strftime('%s','now')/" | \
sed 's/ unsigned / /g' | \
sed 's/ auto_increment/ /gi' | \
sed 's/ smallint([0-9]*) / integer /gi' | \
sed 's/ mediumint([0-9]*) / integer /gi' | \
sed 's/ tinyint([0-9]*) / integer /gi' | \
sed 's/ int([0-9]*) / integer /gi' | \
sed 's/ character set [^ ]* / /gi' | \
sed 's/ collate [^ ]* / /gi' | \
sed 's/ enum([^)]*) / varchar(255) /gi' | \
sed 's/ on update [^,]*//gi'
|