I just started learning YII framework and now I am facing an issue while trying to create table through YIIC MIGRATE. Below is the code of my table.
class m140627_072906_create_test_table extends CDbMigration
{
public function up()
{
$this->create('tbl_locations',
array(
'id'=>'pk',
'location_name'=>'string NOT NULL',
'create_time'=>'datetime NOT NULL',
'create_user_id'=>'int(11) NOT NULL',
'update_time'=>'datetime NOT NULL',
'update_user_id'=>'int(11) NOT NULL',
), 'ENGINE=InnoDB'
);
}
}
public function down()
{
echo "m140627_072906_create_test_table does not support migration down.\n";
return false;
}
}
My project is under C:\wamp\www\bookmyroom\ and below is the folder structure
C:\wamp\www\bookmyroom>dir
Volume in drive C has no label.
Volume Serial Number is 5291-FE18
Directory of C:\wamp\www\bookmyroom
06/25/2014 08:58 PM <DIR> .
06/25/2014 08:58 PM <DIR> ..
06/27/2014 12:32 PM <DIR> assets
06/25/2014 07:05 PM <DIR> css
06/25/2014 09:04 PM <DIR> framework
06/25/2014 07:05 PM <DIR> images
06/25/2014 07:05 PM 466 index-test.php
06/25/2014 09:10 PM 456 index.php
06/25/2014 07:08 PM <DIR> nbproject
06/25/2014 07:05 PM <DIR> protected
06/25/2014 07:05 PM <DIR> themes
2 File(s) 922 bytes
9 Dir(s) 8,986,624,000 bytes free
I runned the YIIC MIgrate command inside the protected folder. I am getting the below error while running migrate command.
C:\wamp\www\bookmyroom\protected>YIIC Migrate
Yii Migration Tool v1.0 (based on Yii v1.1.14)
Total 1 new migration to be applied:
m140627_074906_create_table_locations
Apply the above migration? (yes|no) [no]:y
*** applying m140627_074906_create_table_locations
exception 'CException' with message 'm140627_074906_create_table_locations and its
behaviors do not have a method or closure named "create".' in
C:\wamp\www\yii\framework\base\CComponent.php:266
Stack trace:
#0
C:\wamp\www\bookmyroom\protected\migrations\m140627_074906_create_table_locations.php
(16): CComponent->__call('create', Array)
#1
C:\wamp\www\bookmyroom\protected\migrations\m140627_074906_create_table_locations.php
(16): m140627_074906_create_table_locations->create('tbl_locat
ions', Array, 'ENGINE=InnoDB')
#2 C:\wamp\www\yii\framework\cli\commands\MigrateCommand.php(385):
m140627_074906_create_table_locations->up()
#3 C:\wamp\www\yii\framework\cli\commands\MigrateCommand.php(109):
MigrateCommand->migrateUp('m140627_074906_...')
#4 [internal function]: MigrateCommand->actionUp(Array)
#5 C:\wamp\www\yii\framework\console\CConsoleCommand.php(172):
ReflectionMethod->invokeArgs(Object(MigrateCommand), Array)
#6 C:\wamp\www\yii\framework\console\CConsoleCommandRunner.php(71):
CConsoleCommand->run(Array)
#7 C:\wamp\www\yii\framework\console\CConsoleApplication.php(92):
CConsoleCommandRunner->run(Array)
#8 C:\wamp\www\yii\framework\base\CApplication.php(180):
CConsoleApplication->processRequest()
#9 C:\wamp\www\yii\framework\yiic.php(33): CApplication->run()
#10 C:\wamp\www\bookmyroom\protected\yiic.php(7): require_once('C:\wamp\www\yii...')
#11 {main}
Can you please check and let me know error which I am facing. If there is any rectification require kindly let me know.
Try using execute
$this->execute("CREATE TABLE `tbl_locations` (
'location_name'=>'string NOT NULL',
'create_time'=>'datetime NOT NULL',
'create_user_id'=>'int(11) NOT NULL',
'update_time'=>'datetime NOT NULL',
'update_user_id'=>'int(11) NOT NULL'
PRIMARY KEY (`id`),
) ENGINE=InnoDB");
Related
I fixed a minor bug in Pandas.
I followed the instructions in the pandas contribution guidelines. I created a new environment, built the pandas source, fixed the bug, ran the testsuite.
All is ready except for the section 'Documenting your code'
It advises:
Changes should be reflected in the release notes located in
doc/source/whatsnew/vx.y.z.rst. This file contains an ongoing change
log for each release. Add an entry to this file to document your fix,
enhancement or (unavoidable) breaking change. Make sure to include the
GitHub issue number when adding your entry (using :issue:1234 where
1234 is the issue/pull request number).
When I look at my \whatsnew directory, I have lots of .rst files. I'm not sure which one to update
Directory of C:\Users\foo\code\pfix\pandas-bar\doc\source\whatsnew
25-Jun-19 10:16 PM <DIR> .
25-Jun-19 10:16 PM <DIR> ..
25-Jun-19 10:16 PM 2,184 index.rst
25-Jun-19 10:16 PM 16,927 v0.10.0.rst
...<clipped for brevity>...
25-Jun-19 10:16 PM 116,771 v0.24.0.rst
25-Jun-19 10:16 PM 3,976 v0.24.1.rst
25-Jun-19 10:16 PM 5,443 v0.24.2.rst
25-Jun-19 10:16 PM 45,462 v0.25.0.rst
25-Jun-19 10:16 PM 3,421 v0.4.x.rst
...<clipped for brevity>...
25-Jun-19 10:16 PM 3,697 v0.9.0.rst
25-Jun-19 10:16 PM 4,973 v0.9.1.rst
25-Jun-19 10:16 PM 20,421 whatsnew_0171_html_table.html
50 File(s) 1,093,274 bytes
2 Dir(s) 738,033,799,168 bytes free
The output of my environment's pd.__version__ is 0.25.0.dev0+791.gf0919f272.dirty My guess is that I should update v0.25.0.rst file, but I'm not certain. Can anyone please advise?
If you are developing for version vx.y.z, then you will be logging your changes in the vx.y.z.rst file. In your case, 0.25.0.rst.
Your pandas version also reflects this (vx.y.z.dev[...]).
can some one tell what below lines indicates. I am using tomcat7 its suddenly goes down after some time . i can see below log in /var/log/messages file. is jvm got crashed ?
Dec 28 17:39:06 track03 abrt[23595]: Saved core dump of pid 9849 (/usr/java/jdk1.6.0_27/bin/java) to /var/spool/abrt/ccpp-2016-12-28-17:38:14-9849 (12624896000 bytes)
Dec 28 17:39:06 track03 abrtd: Directory 'ccpp-2016-12-28-17:38:14-9849' creation detected
Dec 28 17:39:07 track03 abrtd: Package 'jdk' isn't signed with proper key
Dec 28 17:39:07 track03 abrtd: 'post-create' on '/var/spool/abrt/ccpp-2016-12-28-17:38:14-9849' exited with 1
Dec 28 17:39:07 track03 abrtd: Deleting problem directory '/var/spool/abrt/ccpp-2016-12-28-17:38:14-9849'
That means process /usr/java/jdk1.6.0_27/bin/java crashed and core dump was saved to directory /var/spool/abrt/ccpp-2016-12-28-17:38:14-9849. But abrtd daemon recognized that package jdk was not signed with GPG key so directory was deleted.
For some more information check:
ABRT logs messages with "Package isn't signed with proper key."
Red Hat Linux error - Package 'rmmagent' isn't signed with proper key
If you want to inspect core dumps you can change default behavior of abrtd in case of third-party packages:
Edit the file /etc/abrt/abrt-action-save-package-data.conf
Set OpenGPGCheck = no
Reload abrtd with the command: service abrtd reload
When I attempt to run a U-SQL script locally, I get the following error :
Start : 7/1/2016 12:53:49 PM
Initialize : 7/1/2016 12:53:49 PM
GraphParse : 7/1/2016 12:53:49 PM
Run : 7/1/2016 12:53:49 PM
Start 'Root' : 7/1/2016 12:53:50 PM
End 'Root(Success)' : 7/1/2016 12:53:50 PM
Start '1_SV1_Extract' : 7/1/2016 12:53:50 PM
End '1_SV1_Extract(Error)' : 7/1/2016 12:53:50 PM
End '1_SV1_Extract(Error)' : 7/1/2016 12:53:50 PM
Completed with 'Error' : 7/1/2016 12:53:50 PM
Execution failed with error 'Failed to start vertex host : 'System.ComponentMode
l.Win32Exception (0x80004005): The specified executable is not a valid applicati
on for this OS platform.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at Microsoft.Analytics.LocalRun.VertexExecutionHost.Start()'
1_SV1_Extract Error : 'System.ComponentModel.Win32Exception (0x80004005): The sp
ecified executable is not a valid application for this OS platform.
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startIn
fo)
at Microsoft.Analytics.LocalRun.VertexExecutionHost.Start()'
'
Execution failed !
I can run scripts in Visual Studio that execute in Data Lake Store, I get the error only when trying to run scripts locally.
I'm using Visual Studio 15 Community on 64-bit Windows 7.
In the case of Windows 7 64-bit, please make sure you have VS 2015 updated 2 installed and also this UCRT update:
https://www.microsoft.com/en-us/download/details.aspx?id=50410
If that still fails, could you please try to open a cmd shell, then try to run
"your project\bin\debug[A long hex string]\localvertexhost.exe" and see if it runs OK?
Are you using a 32-bit Windows 7? The U-SQL local run requires 64-bit Windows to work.
Sincerely,
Yu Dong
I have encountered a problem with running Jboss as service on Fedora. Here is the log I have after using command: systemctl status jboss-as.service
Here is the log I have been receiving:
jboss-as.service - SYSV: JBoss AS Standalone
Loaded: loaded (/etc/rc.d/init.d/jboss-as)
Active: failed (Result: resources) since Thu 2014-01-16 09:31:54 CET; 46min ago
Process: 501 ExecStart=/etc/rc.d/init.d/jboss-as start (code=exited, status=0/SUCCESS)
Jan 16 09:31:22 servername.domain systemd[1]: Starting SYSV: JBoss AS Standalone...
Jan 16 09:31:23 servername.domain jboss-as[501]: Starting jboss-as: chown: missing operand after ‘/var/run/jboss-as’
Jan 16 09:31:23 servername.domain jboss-as[501]: Try 'chown --help' for more information.
Jan 16 09:31:54 servername.domain jboss-as[501]: [ OK ]
Jan 16 09:31:54 servername.domain systemd[1]: PID file /var/run/jboss-as/jboss-as-standalone.pid not readable (yet?) after start.
Jan 16 09:31:54 servername.domain systemd[1]: Failed to start SYSV: JBoss AS Standalone.
Jan 16 09:31:54 servername.domain systemd[1]: Unit jboss-as.service entered failed state.
First, I tried to find a solution for the chown: missin operand after ... problem and found something: here but it did not help. And also, I was looking for the answer for the PID file problem but it does not even exist in in the location: var/run/jboss-as/
This is because the startup script uses the variable $JBOSS_USER but it is not defined inside the script.
Please put in the file /etc/jboss-as/jboss-as.conf the following line:
JBOSS_USER=root
(change the root with other dedicated linux user e.g. jboss-as)
It looks like the service startup script expects to be able to write to the /var/run/jboss-as directory but doesn't have permissions to do so.
In your place I'd ensure that this directory is owned by the user that runs JBoss and that it is writable.
Check that there aren't other errors (particularly missing or incorrect paths) in your /etc/rc.d/init.d/jboss-as file (I assume you copied it from the jboss install folder to create a startup script.
I had the same issue until I fixed a completely unrelated link in that script, then it went away.
In Centos 7, if you straight way copying the jboss-as-standalone.sh in /etc/rc.d/init.d/, ensure JBOSS_CONF and JBOSS_HOME path is correct.
For me, it was with systemd. When I set the service y put wrong the PID File.
Example:
In the service was like
/var/run/jboss-as/jboss-as-standalone.pid
But in the script was like
/var/run/jboss-as/jboss-as.pid
I'm trying to use yiic shell and yiic migrate tools on my iMac but I seem to be running in to some difficulties. I think it may be because I am using AMPPS as my development server instead of having installed Apache/PHP/MySQL separately. For example, in my project I have a model named Project that corresponds to a table in my MySQL database named tbl_project. I can invoke the yiic shell using :
./yiic shell /Applications/AMPPS/www/TrackStar/protected/config/main.php
However, when I run:
var_dump(Project::model()->findAll('id = 1'));
I get this lengthy error message:
Warning: PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in /Applications/AMPPS/YiiRoot/framework/db/CDbConnection.php on line 423
exception 'CDbException' with message 'CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or directory' in /Applications/AMPPS/YiiRoot/framework/db/CDbConnection.php:381
Stack trace:
#0 /Applications/AMPPS/YiiRoot/framework/db/CDbConnection.php(330): CDbConnection->open()
#1 /Applications/AMPPS/YiiRoot/framework/db/CDbConnection.php(308): CDbConnection-> setActive(true)
#2 /Applications/AMPPS/YiiRoot/framework/base/CModule.php(387): CDbConnection->init()
#3 /Applications/AMPPS/YiiRoot/framework/base/CModule.php(103): CModule->getComponent('db')
#4 /Applications/AMPPS/YiiRoot/framework/cli/commands/ShellCommand.php(131) : eval()'d code(1): CModule->__get('db')
#5 /Applications/AMPPS/YiiRoot/framework/cli/commands/ShellCommand.php(131): eval()
#6 /Applications/AMPPS/YiiRoot/framework/cli/commands/ShellCommand.php(99): ShellCommand->runShell()
#7 /Applications/AMPPS/YiiRoot/framework/console/CConsoleCommandRunner.php(67): ShellCommand->run(Array)
#8 /Applications/AMPPS/YiiRoot/framework/console/CConsoleApplication.php(91): CConsoleCommandRunner->run(Array)
#9 /Applications/AMPPS/YiiRoot/framework/base/CApplication.php(169): CConsoleApplication->processRequest()
#10 /Applications/AMPPS/YiiRoot/framework/yiic.php(33): CApplication->run()
#11 /Applications/AMPPS/www/TrackStar/protected/yiic.php(7): require_once('/Applications/A...')
#12 /Applications/AMPPS/www/TrackStar/protected/yiic(4): require_once('/Applications/A...')
#13 {main}
I think it is perhaps because it is trying to connect via
unix:///var/mysql/mysql.sock
which isn't where my MySQL shell resides. I have configured my config/main.php and config/console.php to reflect:
'db'=>array(
'connectionString' => 'mysql:host=localhost;dbname=trackstar',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'mysql',
'charset' => 'utf8',
),
Can anyone help? I have the same problem when I try to use the migrations feature.
I think you should define the correct path to the socket
connectionString=>msql:host=localhost;dbname=trackstar;unix_socket=socket/path',