mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
add migration info
This commit is contained in:
parent
1e3f8d1c4a
commit
27621b093b
6
.env
6
.env
@ -49,3 +49,9 @@ SUPPORT_EMAIL=YOUR_EMAIL
|
|||||||
###> symfony/mailer ###
|
###> symfony/mailer ###
|
||||||
MAILER_DSN=smtp://localhost
|
MAILER_DSN=smtp://localhost
|
||||||
###< symfony/mailer ###
|
###< symfony/mailer ###
|
||||||
|
## Migration from v1
|
||||||
|
OLD_DATABASE_NAME=framadate
|
||||||
|
OLD_DATABASE_USER=framadate
|
||||||
|
OLD_DATABASE_PASS=framadate
|
||||||
|
### UNIQ_INSTALL_KEY must be really unique
|
||||||
|
UNIQ_INSTALL_KEY=superCaliFragilistiExpialidousiousse
|
||||||
|
@ -61,8 +61,10 @@ php bin/console doctrine:schema:validate
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
|
### Migrating from V1
|
||||||
# Development
|
Follow the migration guide
|
||||||
|
[doc/migration.md]()
|
||||||
|
### Development
|
||||||
install dependencies with Composer
|
install dependencies with Composer
|
||||||
|
|
||||||
|
|
||||||
|
16
doc/migration.md
Normal file
16
doc/migration.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Migration depuis la version 1 de Framadate
|
||||||
|
|
||||||
|
Cela va importer vos anciens sondages dans les tables de la nouvelle version.
|
||||||
|
|
||||||
|
* Remplissez les accès en base de données concernant la version 1 de Framadate dans votre fichier [.env](../.env) à la racine de ce dossier.
|
||||||
|
* Choisissez une chaine unique dans votre fichier .env à la place de superCaliFragilistiExpialidousiousse
|
||||||
|
* Une fois votre application accessible via navigateur, rendez vous sur votre point d'accès web à l'addresse /migration-from-v1/superCaliFragilistiExpialidousiousse en changeant __superCaliFragilistiExpialidousiousse__ par votre variable unique.
|
||||||
|
* tadam, vous aurez un message indiquant si vous avez réussi la migration.
|
||||||
|
|
||||||
|
|
||||||
|
## Comparaison de schémas
|
||||||
|
pour information, voici les schémas des bases de données des deux versions:
|
||||||
|
### Ancien
|
||||||
|
![old](../public/assets/img/framadate_v1_schema.svg)
|
||||||
|
### Nouveau
|
||||||
|
![old](../public/assets/img/framadate_funky_schema.svg)
|
32
src/Controller/MigrationController.php
Executable file
32
src/Controller/MigrationController.php
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controller;
|
||||||
|
|
||||||
|
use App\Entity\Poll;
|
||||||
|
use FOS\RestBundle\Controller\Annotations\Get;
|
||||||
|
use FOS\RestBundle\Controller\Annotations\Route;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class DefaultController
|
||||||
|
* @package App\Controller
|
||||||
|
* @Route("/migration-from-v1",name="admin_homepage")
|
||||||
|
*/
|
||||||
|
class MigrationController extends FramadateController {
|
||||||
|
/**
|
||||||
|
* @Get(path ="/{unique_key}",
|
||||||
|
* name = "_migrate_from_v1")
|
||||||
|
*/
|
||||||
|
public function indexAction() {
|
||||||
|
// get env vars
|
||||||
|
// check uniq key is good
|
||||||
|
// fetch old Database
|
||||||
|
// gather objects
|
||||||
|
// create new polls
|
||||||
|
// success
|
||||||
|
// failure notice
|
||||||
|
|
||||||
|
return $this->json( [ "message" => "welcome to the framadate migration endpoint, it has yet to be done" ],
|
||||||
|
200 );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user