Comments (5)
Make the column $table->integer('school_id');
nullable in users migration table. Let me know if it works.
$table->integer('school_id')->nullable();
from unifiedtransform.
Sorry I must have missed the email when you first responded.
I tried adding ->nullable()
there. That worked, but exposed the next error of the same type. Here's the set of them:
SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint fai
led: users.code (SQL: insert into "users" ("name", "email", "password", "ro
le", "active", "verified") values (hasib, [email protected], $2y$1
0$vU0W7YPwYTDRCDlCHhL1wOaNSStj7YLUDpKCAdOFBgxKzRmar.lVK, master, 1, 1))
SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint fai
led: users.student_code (SQL: insert into "users" ("name", "email", "passwo
rd", "role", "active", "verified") values (hasib, [email protected]
m, $2y$10$c93O5X8FeJhIgXVfBghaheiOv0yCrsa/SvQwlnzZesnxdeGNZGUUa, master, 1,
1))
SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint fai
led: student_infos.user_id (SQL: insert into "student_infos" ("student_id",
"session", "version", "group", "birthday", "religion", "father_name", "fat
her_phone_number", "father_national_id", "father_occupation", "father_desig
nation", "father_annual_income", "mother_name", "mother_phone_number", "mot
her_national_id", "mother_occupation", "mother_designation", "mother_annual
_income", "updated_at", "created_at") values (141, 2019, english, , 1922-08
-31, buddhism, Ezekiel Kerluke, 944571, SA0218IBYZVZJSEC8536V4XC, Mathemati
cal Science Teacher, Cook, 1000000, Nelle Berge, 3613916, SA0218IBYZVZJSEC8
536V4XC, Motorcycle Mechanic, Library Worker, 500000, 2019-06-25 01:05:21,
2019-06-25 01:05:21))
SQLSTATE[23000]: Integrity constraint violation: 19 NOT NULL constraint fai
led: student_board_exams.user_id (SQL: insert into "student_board_exams" ("
student_id", "exam_name", "group", "roll", "registration", "session", "boar
d", "passing_year", "institution_name", "gpa", "updated_at", "created_at")
values (67, A Level, arts, 4738146, 699750, 2018-19, rajsahi, 2011, efnj sc
hool, 5, 2019-06-25 02:10:31, 2019-06-25 02:10:31))
Here's a git branch with each of them set nullable()
:
master...jbartus:master
That successfully completes the php artisan db:seed
step, however when you login to the resulting app and click the Manage Schools button you get this error
Type error: Argument 2 passed to App\Model::scopeBySchool() must be of the type int, null given, called in /var/www/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php on line 955
Querying the sqlite database file it checks out:
# sqlite3 -line database.sqlite "select school_id from users where name='hasib'"
school_id =
I setup another environment using mysql with the master branch here (so none of my ->nullable()
edits), and it works fine. The key difference seems to be here:
# mysql -u root -p'<snip>' -h'<snip>' unifiedtransform -e "select school_id from users where name='hasib';"
school_id
0
Hmmm where'd that zero come from:
# mysql -u root -p'<snip>' -h'<snip>' unifiedtransform -e "show create table users\G" | grep school_id
`school_id` int(11) NOT NULL,
It looks like mysql defaults to zero for an int thats defined as not null but passed a null value.
I'm not sure what the right next step is here, maybe nothing, just figured I'd share my results w/you.
from unifiedtransform.
@changeweb I don't see a way to re-open this, and that's your call, so just @'ing you to make sure this didn't get lost in the void.
from unifiedtransform.
@jbartus Thanks for sharing your result. It may help others who may face similar issue.
Unfortunately I can't focus on this issue right now but I am reopening this issue.
I will suggest you try any Laravel Sqlite package to work with this software. Hope that will work in your case.
from unifiedtransform.
@jbartus maybe if you run composer require doctrine/dbal
fix that.
I run dusk test with sqlite in pull request #174 add doctrine/dbal.
Here more info.
from unifiedtransform.
Related Issues (20)
- Issues found on UnifiedTransform system HOT 3
- Issue on the Password Length HOT 1
- Issue on the Marking System HOT 1
- Minor Issue in Unified Transform system HOT 2
- composer install error HOT 5
- db failed: No such host is known HOT 2
- payment menu HOT 1
- mysql: [Warning] World-writable config file '/etc/mysql/my.cnf' is ignored. HOT 1
- I can't delete any information HOT 4
- Error - ROUTINE HOT 2
- Documents HOT 2
- Hosting on 00web HOT 1
- Does UT only work with docker? Where is the tutorial without docker? HOT 17
- Add Teacher & Add Student Feature Not Showing HOT 1
- Help needed for V1. HOT 17
- How to translate Brazilian Portuguese HOT 4
- reset password not working
- How to login as a teacher and student?
- Issue with purify folder.
- You bish
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unifiedtransform.