socioboard / socioboard-core

This is an old repo, for latest maintained version go here - https://github.com/socioboard/Socioboard-Core-3.0
http://www.socioboard.org
238 stars 120 forks source link

Database Schema Missing fields? #27

Closed imadbakir closed 8 years ago

imadbakir commented 8 years ago

Hi, I'm trying to install this from the latest version, DB connection is fine, imported everything, when I try to register I get "Email already exists", and my log file points to some kind of "uknown field" so what is the problem? is there a missing column in users table?

ERROR2016-02-02 03:23:31 Class:Api.Socioboard.Global Method:Application_BeginRequest Line #: 79  – startIndex cannot be larger than length of string.
Parameter name: startIndex
ERROR2016-02-02 03:23:31 Class:Api.Socioboard.Global Method:Application_BeginRequest Line #: 80  –    at System.String.Substring(Int32 startIndex, Int32 length)
   at Api.Socioboard.Global.Application_BeginRequest(Object sender, EventArgs e) in \\vmware-host\shared folders\imadbakir\Downloads\socioboard-core-master\SocioBoard\SocioboardAPI\Global.asax.cs:line 74
ERROR2016-02-02 03:24:02 Class:Api.Socioboard.Global Method:Application_BeginRequest Line #: 79  – Length cannot be less than zero.
Parameter name: length
ERROR2016-02-02 03:24:02 Class:Api.Socioboard.Global Method:Application_BeginRequest Line #: 80  –    at System.String.Substring(Int32 startIndex, Int32 length)
   at Api.Socioboard.Global.Application_BeginRequest(Object sender, EventArgs e) in \\vmware-host\shared folders\imadbakir\Downloads\socioboard-core-master\SocioBoard\SocioboardAPI\Global.asax.cs:line 74
ERROR2016-02-02 03:24:14 Class:Api.Socioboard.Services.User Method:Register Line #: 152  – Register
ERROR2016-02-02 03:24:16 Class:? Method:lambda_method Line #: 0  – Could not execute query: select user0_.Id as Id0_, user0_.UserName as UserName0_, user0_.EmailId as EmailId0_, user0_.ProfileUrl as ProfileUrl0_, user0_.AccountType as AccountT5_0_, user0_.CreateDate as CreateDate0_, user0_.ExpiryDate as ExpiryDate0_, user0_.UserStatus as UserStatus0_, user0_.Password as Password0_, user0_.TimeZone as TimeZone0_, user0_.PaymentStatus as Payment11_0_, user0_.ActivationStatus as Activat12_0_, user0_.CouponCode as CouponCode0_, user0_.ReferenceStatus as Referen14_0_, user0_.RefereeStatus as Referee15_0_, user0_.UserType as UserType0_, user0_.ChangePasswordKey as ChangeP17_0_, user0_.IsKeyUsed as IsKeyUsed0_, user0_.ChangeEmailKey as ChangeE19_0_, user0_.IsEmailKeyUsed as IsEmail20_0_, user0_.Ewallet as Ewallet0_, user0_.UserCode as UserCode0_, user0_.SocialLogin as SocialL23_0_, user0_.LastLoginTime as LastLog24_0_ from User user0_ where user0_.EmailId=?p0
MySql.Data.MySqlClient.MySqlException (0x80004005): Unknown column 'user0_.LastLoginTime' in 'field list'
   at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
   at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId)
   at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
   at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
ERROR2016-02-02 03:24:17 Class:? Method:lambda_method Line #: 0  – Unknown column 'user0_.LastLoginTime' in 'field list'
ERROR2016-02-02 03:24:17 Class:? Method:lambda_method Line #: 0  – Unknown column 'user0_.LastLoginTime' in 'field list'
ERROR2016-02-02 03:24:17 Class:? Method:lambda_method Line #: 0  – Unknown column 'user0_.LastLoginTime' in 'field list'
socioboard commented 8 years ago

Hi, It seems there is a missing column in the github db schema,To fix this issue, add "SocioalLogin" column in your "user" table or drop "user" table and create again with below schema. we will update our schema in next release.

CREATE TABLEuser( IdBINARY(16) NOT NULL, UserNameVARCHAR(350) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', EmailIdVARCHAR(350) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', ProfileUrlVARCHAR(350) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', AccountTypeVARCHAR(350) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', CreateDateDATETIME NULL DEFAULT NULL, ExpiryDateDATETIME NULL DEFAULT NULL, UserStatusTINYINT(1) NULL DEFAULT NULL COMMENT '0 = InActive,1 = Active|| unpaid,2=Active||paid', PasswordVARCHAR(350) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', TimeZoneVARCHAR(350) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', ChangePasswordKeyVARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', IsKeyUsedTINYINT(1) NULL DEFAULT '0', PaymentStatusVARCHAR(6) NULL DEFAULT 'unpaid' COMMENT 'default value = unpaid' COLLATE 'utf8_unicode_ci', ActivationStatusVARCHAR(5) NULL DEFAULT '0' COMMENT '0 = InActive,1 = Active' COLLATE 'utf8_unicode_ci', CouponCodeVARCHAR(350) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', ReferenceStatusVARCHAR(5) NULL DEFAULT '0' COLLATE 'utf8_unicode_ci', RefereeStatusVARCHAR(5) NULL DEFAULT '0' COLLATE 'utf8_unicode_ci', UserTypeVARCHAR(350) NULL DEFAULT 'user' COMMENT 'default value=user' COLLATE 'utf8_unicode_ci', ChangeEmailKeyVARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', IsEmailKeyUsedTINYINT(4) NULL DEFAULT '0', EwalletVARCHAR(50) NULL DEFAULT '0' COLLATE 'utf8_unicode_ci', UserCodeVARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', SocialLoginVARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8_unicode_ci', LastLoginTimeDATETIME NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (Id) ) COLLATE='utf8_unicode_ci' ENGINE=InnoDB ;

imadbakir commented 8 years ago

Hi, thanks a lot for the dump, it worked, now am stuck somewhere else, I will be waiting for the next release, Cool app, good work guys.

socioboard commented 8 years ago

@imadbakir , thanks, everything working Ok? I will be marking this as closed if you are up and running correctly.