statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
3.72k stars 510 forks source link

Creating new user from cp with users in database says missing table #2392

Closed twd3 closed 3 years ago

twd3 commented 4 years ago

With users in a database using the default migrations a table called password_activations doesn't get made. If you go to create a new user via the CP you get the error below. I could just make this table but I don't know what is supposed to be in there.

Extra Detail

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'forge_local.password_activations' doesn't exist (SQL: delete from password_activations where email = tom@blah.com)C:_statamic\ma\vendor\laravel\framework\src\Illuminate\Database\Connection.php#671Illuminate\Database\QueryException SQLSTATE[42S02]: Base table or view not found: 1146 Table 'forge_local.password_activations' doesn't existC:_statamic\ma\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php#72Doctrine\DBAL\Driver\PDOException SQLSTATE[42S02]: Base table or view not found: 1146 Table 'forge_local.password_activations' doesn't existC:_statamic\ma\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php#67

Environment

Statamic 3.0.7 Pro Laravel 7.26.1 PHP 7.4.6 aryehraber/statamic-captcha 1.0.3 edalzell/anvil 1.0.4 optimoapps/statamic-bard-text-align 1.0.0 silentz/charge 4.0.2 spatie/statamic-responsive-images 1.2.3

Install method (choose one):

twd3 commented 4 years ago

I can figure this out later no biggie.

AntiCZ commented 3 years ago

But this is a bug. Why are you closing it?

Postgresql:

CREATE TABLE password_activations (
    email VARCHAR,
    token VARCHAR,
    created_at TIMESTAMPTZ
);

PHP:

in /App/User.php add

/**
 * Get the password for the user.
 *
 * @return string
 */
public function password()
{
    return $this->password;
}
jasonvarga commented 3 years ago

Please try again after upgrading Statamic. I believe this was fixed in 3.0.9.

jbardnz commented 3 years ago

I'm getting this exact issue on my site, I installed 3.0.15 and have updated to 3.0.16.

edalzell commented 3 years ago

Confirmed, I get this in 3.0.23.

github-actions[bot] commented 3 years ago

This issue has not had recent activity and has been marked as stale — by me, a robot. Simply reply to keep it open and send me away. If you do nothing, I will close it in a week. I have no feelings, so whatever you do is fine by me.

mrpatricko commented 3 years ago

Still getting this error in Statamic v3.1.29

Just wondering what the best method is to make these errors go away, as opposed to ignoring them.


EDIT: Fixed with this thread... https://github.com/statamic/cms/issues/2650