Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
framadate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
framadate
Commits
c533645d
Commit
c533645d
authored
10 years ago
by
Olivier PEREZ
Browse files
Options
Downloads
Patches
Plain Diff
Make installation from scratch work with migration page
parent
1578703d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/classes/Framadate/Migration/From_0_0_to_0_8_Migration.php
+60
-0
60 additions, 0 deletions
...classes/Framadate/Migration/From_0_0_to_0_8_Migration.php
bandeaux.php
+1
-1
1 addition, 1 deletion
bandeaux.php
migration.php
+2
-0
2 additions, 0 deletions
migration.php
with
63 additions
and
1 deletion
app/classes/Framadate/Migration/From_0_0_to_0_8_Migration.php
0 → 100644
+
60
−
0
View file @
c533645d
<?php
namespace
Framadate\Migration
;
class
From_0_0_to_0_8_Migration
implements
Migration
{
function
__construct
()
{
}
/**
* This methode is called only one time in the migration page.
*
* @param \PDO $pdo The connection to database
* @return bool true is the execution succeeded
*/
function
execute
(
\PDO
$pdo
)
{
$pdo
->
exec
(
'
CREATE TABLE IF NOT EXISTS `sondage` (
`id_sondage` char(16) NOT NULL,
`commentaires` text,
`mail_admin` varchar(128) DEFAULT NULL,
`nom_admin` varchar(64) DEFAULT NULL,
`titre` text,
`id_sondage_admin` char(24) DEFAULT NULL,
`date_creation` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`date_fin` timestamp NOT NULL DEFAULT \'0000-00-00 00:00:00\',
`format` varchar(2) DEFAULT NULL,
`mailsonde` tinyint(1) DEFAULT \'0\',
`statut` int(11) NOT NULL DEFAULT \'1\' COMMENT \'1 = actif ; 0 = inactif ; \',
UNIQUE KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;'
);
$pdo
->
exec
(
'
CREATE TABLE IF NOT EXISTS `sujet_studs` (
`id_sondage` char(16) NOT NULL,
`sujet` text,
KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;'
);
$pdo
->
exec
(
'
CREATE TABLE IF NOT EXISTS `comments` (
`id_comment` int(11) unsigned NOT NULL AUTO_INCREMENT,
`id_sondage` char(16) NOT NULL,
`comment` text NOT NULL,
`usercomment` text,
PRIMARY KEY (`id_comment`),
KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;'
);
$pdo
->
exec
(
'
CREATE TABLE IF NOT EXISTS `user_studs` (
`id_users` int(11) unsigned NOT NULL AUTO_INCREMENT,
`nom` varchar(64) NOT NULL,
`id_sondage` char(16) NOT NULL,
`reponses` text NOT NULL,
PRIMARY KEY (`id_users`),
KEY `id_sondage` (`id_sondage`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;'
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
bandeaux.php
+
1
−
1
View file @
c533645d
...
...
@@ -46,7 +46,7 @@ function bandeau_titre($titre)
global
$connect
;
$tables
=
$connect
->
allTables
();
$diff
=
array_diff
(
$
table
s
,
[
'comment'
,
'poll'
,
'slot'
,
'vote'
]
);
$diff
=
array_diff
(
[
Utils
::
table
(
'comment'
)
,
Utils
::
table
(
'poll'
)
,
Utils
::
table
(
'slot'
)
,
Utils
::
table
(
'vote'
)],
$tables
);
if
(
0
!=
count
(
$diff
))
{
echo
'<div class="alert alert-danger">'
.
_
(
'Framadate is not properly installed, please check the "INSTALL" to setup the database before continuing.'
)
.
'</div>'
;
bandeau_pied
();
...
...
This diff is collapsed.
Click to expand it.
migration.php
+
2
−
0
View file @
c533645d
<?php
use
Framadate\Migration\From_0_0_to_0_8_Migration
;
use
Framadate\Migration\From_0_8_to_0_9_Migration
;
use
Framadate\Migration\Migration
;
use
Framadate\Utils
;
...
...
@@ -11,6 +12,7 @@ function output($msg) {
// List a Migration sub classes to execute
$migrations
=
[
new
From_0_0_to_0_8_Migration
(),
new
From_0_8_to_0_9_Migration
()
];
// ---------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment