Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
56beed8d
Commit
56beed8d
authored
May 19, 2017
by
Francesc Guasch
Browse files
[#235] create tables for sqlite too
parent
2f186288
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
56beed8d
...
...
@@ -266,12 +266,16 @@ sub _insert_data {
sub
_create_tables
{
my
$self
=
shift
;
return
if
$CONNECTOR
->
dbh
->
{
Driver
}{
Name
}
!~
/mysql/i
;
# return if $CONNECTOR->dbh->{Driver}{Name} !~ /mysql/i;
my
$driver
=
lc
(
$CONNECTOR
->
dbh
->
{
Driver
}{
Name
});
$DIR_SQL
=~
s{(.*)/.*}{$1/$driver}
;
opendir
my
$ls
,
$DIR_SQL
or
die
"
$!
$DIR_SQL
";
while
(
my
$file
=
readdir
$ls
)
{
my
(
$table
)
=
$file
=~
m{(.*)\.sql$}
;
next
if
!
$table
;
next
if
$table
=~
/^insert/
;
$self
->
_insert_data
(
$table
)
if
$self
->
_create_table
(
$table
);
}
closedir
$ls
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment