Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/topic.php on line 737
Форумы портала PHP.SU :: laravel 4

 PHP.SU

Программирование на PHP, MySQL и другие веб-технологии
PHP.SU Портал     На главную страницу форума Главная     Помощь Помощь     Поиск Поиск     Поиск Яндекс Поиск Яндекс     Вакансии  Пользователи Пользователи


 Страниц (1): [1]   

> Описание: не выполняется миграция
coa
Отправлено: 14 Июня, 2014 - 20:30:39
Post Id


Новичок


Покинул форум
Сообщений всего: 4
Дата рег-ции: Июнь 2014  


Помог: 0 раз(а)




Расскажите, как создать миграцию для создания таблицы?

Сам вот как делаю - у меня запущен на внешку openServer, в нем создаю базу данных myBD и в laravel в database.php пишу -
PHP:
скопировать код в буфер обмена
  1. <?PHP
  2.  
  3. return array(
  4.  
  5.         /*
  6.         |--------------------------------------------------------------------------
  7.         | PDO Fetch Style
  8.         |--------------------------------------------------------------------------
  9.         |
  10.         | By default, database results will be returned as instances of the PHP
  11.         | stdClass object; however, you may desire to retrieve records in an
  12.         | array format for simplicity. Here you can tweak the fetch style.
  13.         |
  14.         */
  15.  
  16.         'fetch' => PDO::FETCH_CLASS,
  17.  
  18.         /*
  19.         |--------------------------------------------------------------------------
  20.         | Default Database Connection Name
  21.         |--------------------------------------------------------------------------
  22.         |
  23.         | Here you may specify which of the database connections below you wish
  24.         | to use as your default connection for all database work. Of course
  25.         | you may use many connections at once using the Database library.
  26.         |
  27.         */
  28.  
  29.         'default' => 'mysql',
  30.  
  31.         /*
  32.         |--------------------------------------------------------------------------
  33.         | Database Connections
  34.         |--------------------------------------------------------------------------
  35.         |
  36.         | Here are each of the database connections setup for your application.
  37.         | Of course, examples of configuring each database platform that is
  38.         | supported by Laravel is shown below to make development simple.
  39.         |
  40.         |
  41.         | All database work in Laravel is done through the PHP PDO facilities
  42.         | so make sure you have the driver for your particular database of
  43.         | choice installed on your machine before you begin development.
  44.         |
  45.         */
  46.  
  47.         'connections' => array(
  48.  
  49.                 'sqlite' => array(
  50.                         'driver'   => 'sqlite',
  51.                         'database' => __DIR__.'/../database/production.sqlite',
  52.                         'prefix'   => '',
  53.                 ),
  54.  
  55.                 'mysql' => array(
  56.                         'driver'    => 'mysql',
  57.                         'host'      => 'xxx.xxx.xxx.xxx',
  58.                         'database'  => 'myBD',
  59.                         'username'  => 'xxx',
  60.                         'password'  => 'xxx',
  61.                         'charset'   => 'utf8',
  62.                         'collation' => 'utf8_unicode_ci',
  63.                         'prefix'    => '',
  64.                 ),
  65.  
  66.                 'pgsql' => array(
  67.                         'driver'   => 'pgsql',
  68.                         'host'     => 'xxx.xxx.xxx.xxx',
  69.                         'database' => 'myBD',
  70.                         'username' => 'xxx',
  71.                         'password' => 'xxx',
  72.                         'charset'  => 'utf8',
  73.                         'prefix'   => '',
  74.                         'schema'   => 'public',
  75.                 ),
  76.  
  77.                 'sqlsrv' => array(
  78.                         'driver'   => 'sqlsrv',
  79.                         'host'     => 'xxx.xxx.xxx.xxx',
  80.                         'database' => 'myBD',
  81.                         'username' => 'xxx',
  82.                         'password' => 'xxx',
  83.                         'prefix'   => '',
  84.                 ),
  85.  
  86.         ),
  87.  
  88.         /*
  89.         |--------------------------------------------------------------------------
  90.         | Migration Repository Table
  91.         |--------------------------------------------------------------------------
  92.         |
  93.         | This table keeps track of all the migrations that have already run for
  94.         | your application. Using this information, we can determine which of
  95.         | the migrations on disk haven't actually been run in the database.
  96.         |
  97.         */
  98.  
  99.         'migrations' => 'migrations',
  100.  
  101.         /*
  102.         |--------------------------------------------------------------------------
  103.         | Redis Databases
  104.         |--------------------------------------------------------------------------
  105.         |
  106.         | Redis is an open source, fast, and advanced key-value store that also
  107.         | provides a richer set of commands than a typical key-value systems
  108.         | such as APC or Memcached. Laravel makes it easy to dig right in.
  109.         |
  110.         */
  111.  
  112.         'redis' => array(
  113.  
  114.                 'cluster' => false,
  115.  
  116.                 'default' => array(
  117.                         'host'     => '127.0.0.1',
  118.                         'port'     => 6379,
  119.                         'database' => 0,
  120.                 ),
  121.  
  122.         ),
  123.  
  124. );


Затем выполняю в консоли -
Цитата:
php artisan migrate:make create_box_table --create=box

По выполнению создается файл - 2014_06_14_171655_create_box_table.php, в котором я немного ещё дописываю и выполняю в консоли -
Цитата:
php artisan migrate

Но таблица не создается... Почему, что делать?

(Отредактировано автором: 14 Июня, 2014 - 20:37:41)

 
 Top
Страниц (1): [1]
Сейчас эту тему просматривают: 0 (гостей: 0, зарегистрированных: 0)
« CMS и фреймворки »


Все гости форума могут просматривать этот раздел.
Только зарегистрированные пользователи могут создавать новые темы в этом разделе.
Только зарегистрированные пользователи могут отвечать на сообщения в этом разделе.
 



Powered by PHP  Powered By MySQL  Powered by Nginx  Valid CSS  RSS

 
Powered by ExBB FM 1.0 RC1. InvisionExBB