I'm just beginning developing with the Yii 2 Framework, and installed the officially advanced app .
The migration script of the user table defines '10' as the default value for the column 'status'.
'status' =>…
I'm trying to use the yii migration system but I'm stuck on this error when I execute this command:
./yiic migrate create basic_data_migrate
I get this error:
PHP Error[2]:…
I am using migrations in Yii to create a new column with. My code works fine however, I am unsure how to set a primary key?
This is a part from my migration file:
public function up()
{
$this->addColumn(
'competition_prizes',
…
I'm trying to use the yii migration system but I'm stuck on this error when I execute this commande:
yiic migrate create add_table_test
I get this error:
exception 'CException' with message 'Property CConsoleApplication.defaultController" is not…
I am learning database migration in Yii2. I am trying to create a new migration class create_news_table using command through composer.
I installed composer globally and running command
yii migrate/create create_news_table
I copied this command…
This code works just fine (all database items updated as expected):
foreach($idMap as $menuId=>$pageId)
{
$sql = "UPDATE `menus_items` SET link = '/content/show?id=".$pageId."' WHERE id = ".$menuId."; ";
$affectedRows =…
I have a Yii framework installed by Composer, webapp in public_html folder and all libraries in vendor folder:
webroot
|
|_public_html
|
|_vendor
|
|_fierwebdesign
|
|_yii-user
|
|_migrations
My configuration in console.php…
I am creating a parent child table using yii migration where there is a foreign key on the child table. I tried using execute but that did not help me fetching the data needed. Is there a way I can query the parent table and insert the parent id on…
I try to run a yii2 basic project with docker in macOS BigSur. This is my docker-compose.yml:
version: '2'
services:
php:
image: yiisoftware/yii2-php:7.4-apache
volumes:
- ~/.composer-docker/cache:/root/.composer/cache:delegated
…
Since I'm required to work on both PHP5.x and PHP7.x projects in Yii framework, I've installed WAMP.
I've also set up my environment variables to link to both paths containing php.exe and for just working with the projects, that's just…
Suddenly any of the migration command is not working in my project and i don't know why. following is the errors in cmd.
C:\wamp64\www\project>yii migrate
Exception 'yii\base\InvalidConfigException' with message 'Failed to instantiate component or…
alter table user add column join_date datetime;
UPDATE user SET join_date = date_created;
By using the code above, I am able to add a new column to the table and set join_date column to have same data as those in date created. How can i perform…
I'm using the basic template for Yii2. I created the project and uploaded it to github so other devs can clone and start contributing.
After cloning and running composer install, I'm getting this error when I try to run yii migrate.
λ php yii…
I'm trying to configure a new Yii2 project to work only using Redis Active Record (http://www.yiiframework.com/doc-2.0/yii-redis-activerecord.html). Redis is not supported like a regular db.
My migration will setup the first user of the application.…