[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/mysql/ -> Makefile (source)

   1  #
   2  # Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3  # Copyright (C) 2005      Laurent Destailleur  <eldy@users.sourceforge.net>
   4  #
   5  # This program is free software; you can redistribute it and/or modify
   6  # it under the terms of the GNU General Public License as published by
   7  # the Free Software Foundation; either version 2 of the License, or
   8  # (at your option) any later version.
   9  #
  10  # This program is distributed in the hope that it will be useful,
  11  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13  # GNU General Public License for more details.
  14  #
  15  # You should have received a copy of the GNU General Public License
  16  # along with this program; if not, write to the Free Software
  17  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18  #
  19  # $Id: Makefile,v 1.25 2005/03/03 22:06:53 eldy Exp $
  20  # $Source: /cvsroot/dolibarr/dolibarr/mysql/Makefile,v $
  21  #
  22  # **********************************************************************
  23  # Ce makefile permet d'initialiser la base de donnée de dolibarr en manuel.
  24  # Il n'est utile que si vous n'utilisez pas l'installateur automatique
  25  # accessible à http://localhost/dolibarr/install/
  26  #
  27  # Pour une installation manuelle, créer la base dolibarr puis faire:
  28  # make table
  29  # make load
  30  #
  31  # Ou bien, toujours après avoir créer la base dolibarr:
  32  # make mysql.sql
  33  # mysql dolibarr < mysql.sql
  34  #
  35  # Le script mysql.sql cotient tous le ordres sql pour créer la base
  36  # Tables + Index et Clés + Données
  37  #
  38  # **********************************************************************
  39  
  40  SQL=mysql 
  41  BASE=dolibarr
  42  OPTIONS=
  43  
  44  FIND=find
  45  #FIND="c:/Program files/cygwin/bin/find"
  46  
  47  
  48  TABLES=$(shell $(FIND) tables/ -name "*sql")
  49  
  50  
  51  all:
  52      cat README
  53  
  54  
  55  show:
  56      cd tables \
  57      && make show BASE=$(BASE) OPTIONS=$(OPTIONS)
  58  
  59  drop:
  60      $(SQL) $(OPTIONS) $(BASE) < drop.sql
  61  
  62  table:
  63      cd tables \
  64      && make create BASE=$(BASE) OPTIONS=$(OPTIONS)
  65  
  66  load:
  67      $(SQL) $(OPTIONS) $(BASE) < data/data.sql
  68  
  69  dev:
  70      cd data \
  71      && make dev BASE=$(BASE) OPTIONS=$(OPTIONS)
  72  
  73  
  74  
  75  
  76  fulldev: drop table load dev
  77  
  78  
  79  dropall: dropdb droppriv
  80  
  81  droppriv:
  82      $(SQL) $(OPTIONS) $(SQL) -e "delete from db where Db='$(BASE)' ; "
  83  
  84  dropdb:
  85      $(SQL) $(OPTIONS) $(SQL) -f -e "drop database if exists $(BASE) ; "
  86  
  87  
  88  
  89  create: drop createdb createpriv
  90  
  91  createdb:
  92      $(SQL) $(OPTIONS) mysql -e "create database $(BASE) ; "
  93  
  94  createpriv:
  95      $(SQL) $(OPTIONS) mysql -e "insert into db (Host, Db) values ('localhost', '$(BASE)') ; "
  96      $(SQL) $(OPTIONS) mysql -e "update db set select_priv     = 'Y'  where db='$(BASE)' ; "
  97      $(SQL) $(OPTIONS) mysql -e "update db set insert_priv     = 'Y'  where db='$(BASE)' ; "
  98      $(SQL) $(OPTIONS) mysql -e "update db set update_priv     = 'Y'  where db='$(BASE)' ; "
  99      $(SQL) $(OPTIONS) mysql -e "update db set delete_priv     = 'Y'  where db='$(BASE)' ; "
 100      $(SQL) $(OPTIONS) mysql -e "update db set create_priv     = 'Y'  where db='$(BASE)' ; "
 101      $(SQL) $(OPTIONS) mysql -e "update db set drop_priv       = 'Y'  where db='$(BASE)' ; "
 102      $(SQL) $(OPTIONS) mysql -e "update db set grant_priv      = 'Y'  where db='$(BASE)' ; "
 103      $(SQL) $(OPTIONS) mysql -e "update db set references_priv = 'Y'  where db='$(BASE)' ; "
 104      $(SQL) $(OPTIONS) mysql -e "update db set index_priv      = 'Y'  where db='$(BASE)' ; "
 105      $(SQL) $(OPTIONS) mysql -e "update db set alter_priv      = 'Y'  where db='$(BASE)' ; "
 106      $(SQL) $(OPTIONS) mysql -e "flush privileges ; "
 107  
 108  
 109  
 110  mysql.sql: $(TABLES) data/data.sql Makefile
 111      echo "-- Fichier généré par make mysql.sql" > mysql.sql
 112      echo "-- Contient les ordres de creation des tables + les clés + les données" >> mysql.sql
 113      echo "-- ;" >> mysql.sql
 114      $(FIND) tables/ -name "*sql" | grep -v "key.sql" | xargs cat | grep -v "^--" | cut -d "-" -f 1 >> mysql.sql
 115      $(FIND) tables/ -name "*sql" | grep "key.sql" | xargs cat | grep -v "^--" | cut -d "-" -f 1 >> mysql.sql
 116      cat data/data.sql | grep -v ^-- >> mysql.sql


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics