summaryrefslogtreecommitdiffstats
path: root/core/command/db
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-17 12:51:30 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-17 12:51:30 +0200
commit6e1881dbe42dbd7f3c7c2afdc446fe6fc5d46e87 (patch)
tree0811cfbff6d3461b6b0748ebc4f109a668e7701b /core/command/db
parentfe1df961c14079313ff7fed591283e0b9e199f38 (diff)
downloadnextcloud-server-6e1881dbe42dbd7f3c7c2afdc446fe6fc5d46e87.tar.gz
nextcloud-server-6e1881dbe42dbd7f3c7c2afdc446fe6fc5d46e87.zip
new console command to generate sql migration scripts
Diffstat (limited to 'core/command/db')
-rw-r--r--core/command/db/generatechangescript.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/core/command/db/generatechangescript.php b/core/command/db/generatechangescript.php
new file mode 100644
index 00000000000..f971124cfdc
--- /dev/null
+++ b/core/command/db/generatechangescript.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Core\Command\Db;
+
+use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class GenerateChangeScript extends Command {
+ protected function configure() {
+ $this
+ ->setName('db:generate-change-script')
+ ->setDescription('generates the change script from the current connected db to db_structure.xml')
+ ->addArgument(
+ 'schema-xml',
+ InputArgument::OPTIONAL,
+ 'the schema xml to be used as target schema',
+ \OC::$SERVERROOT . '/db_structure.xml'
+ )
+ ;
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output) {
+
+ $file = $input->getArgument('schema-xml');
+
+ $schemaManager = new \OC\DB\MDB2SchemaManager(\OC_DB::getConnection());
+
+ try {
+ $result = $schemaManager->updateDbFromStructure($file, true);
+ $output->writeln($result);
+ } catch (\Exception $e) {
+ $output->writeln('Failed to update database structure ('.$e.')');
+ }
+
+ }
+}
ter( "sharebymail", { "Shared with %1$s" : "Bendrinama su %1$s", "Shared with {email}" : "Bendrinama su {email}", "Shared with %1$s by %2$s" : "%2$s bendrina su %1$s", "Shared with {email} by {actor}" : "{actor} bendrina su {email}", "Password for mail share sent to %1$s" : "Slaptažodis pasidalinimui per elektroninį paštą išsiųstas %1$s", "Password for mail share sent to {email}" : "Slaptažodis pasidalinimui per elektroninį paštą išsiųstas {email}", "Password for mail share sent to you" : "Jums išsiųstas slaptažodis pasidalinimui per elektroninį paštą", "You shared %1$s with %2$s by mail" : "Jūs paštu pradėjote bendrinti %1$s su %2$s", "You shared {file} with {email} by mail" : "Jūs paštu pradėjote bendrinti {file} su {email}", "%3$s shared %1$s with %2$s by mail" : "%3$s paštu pradėjo bendrinti %1$s su %2$s", "{actor} shared {file} with {email} by mail" : "{actor} paštu pradėjo bendrinti {file} su {email}", "Password to access %1$s was sent to %2s" : "Slaptažodis, skirtas prieigai prie %1$s, buvo išsiųstas į %2s", "Password to access {file} was sent to {email}" : "Slaptažodis, skirtas prieigai prie {file}, buvo išsiųstas į {email}", "Password to access %1$s was sent to you" : "Jums buvo išsiųstas slaptažodis, prisijungimui prie %1$s ", "Password to access {file} was sent to you" : "Jums buvo išsiųstas slaptažodis, skirtas prieigai prie {file}", "Sharing %s failed, this item is already shared with %s" : "%s bendrinimas nepavyko, šis elementas jau yra bendrinamas su %s", "We can't send you the auto-generated password. Please set a valid email address in your personal settings and try again." : "Negalime atsiųsti automatiškai sugeneruoto slaptažodžio. Prašome nurodykite teisingą el. pašto adresą savo nustatymuose ir tada bandykite iš naujo.", "Failed to send share by email" : "Nepavyko išsiųsti bendrinimo el. paštu", "%s shared »%s« with you" : "%s pradėjo bendrinti su jumis »%s«", "%s shared »%s« with you." : "%s pasidalintas »%s«  su Jumis.", "Click the button below to open it." : "Norėdami atverti failą, spustelėkite mygtuką žemiau.", "Open »%s«" : "Atidaryti »%s«", "%s via %s" : "%s per %s", "Password to access »%s« shared to you by %s" : "Slaptažodis, skirtas prieigai prie »%s« pasidalintas su jumis per %s", "%s shared »%s« with you.\nYou should have already received a separate mail with a link to access it.\n" : "%s pasidalintas »%s«  su Jumis.\nJūs turėjote gauti elektroninį laišką su prieigos nuoroda.\n", "%s shared »%s« with you. You should have already received a separate mail with a link to access it." : "%s pasidalintas »%s«  su Jumis. Jūs turėjote gauti elektroninį laišką su prieigos nuoroda.", "Password to access »%s«" : "Slaptažodis prieigai prie »%s«", "It is protected with the following password: %s" : "Apsaugotas slaptažodžiu: %s", "Password to access »%s« shared with %s" : "Slaptažodis prieigai prie »%s« pasidalintas su %s", "This is the password: %s" : "Štai yra slaptažodis: %s", "You can choose a different password at any time in the share dialog." : "Bendrinimo dialoge bet kuriuo metu galite pasirinkti kitą slaptažodį.", "Could not find share" : "Nepavyko rasti viešinio", "Share by mail" : "Bendrinama per el. paštą", "Allows users to share a personalized link to a file or folder by putting in an email address." : "Leidžia vartotojams bendrinti asmeninę nuorodą į failą ar aplanką, pateikiant el. pašto adresą.", "Send password by mail" : "Siųti slaptažodį elektroniniu paštu", "Failed to send share by E-mail" : "Nepavyko išsiųsti bendrinimo el. paštu", "Failed to create the E-mail" : "Nepavyko sukurti el. pašto", "Cheers!" : "Sveikinimai!", "Hey there,<br><br>%s shared <a href=\"%s\">%s</a> with you.<br><br>" : "Sveiki,<br><br>%s pradėjo su jumis bendrinti <a href=\"%s\">%s</a>.<br><br>" }, "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);");