Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequelize.BOOLEAN currently forces user to have to input a value on insert/update #16

Closed
assertchris opened this issue Aug 30, 2010 · 7 comments

Comments

@assertchris
Copy link

After requiring I simply have to add...

Sequelize.BOOLEAN = "TINYINT(1) NULL";

...or I will get an error if I leave out any boolean field values on insert/update (save).

@sdepold
Copy link
Member

sdepold commented Aug 31, 2010

Yep you are right. I've chosen NOT NULL because it doesn't make any sense to have a boolean value with 3 states ^_^ The problem is, that you currently can't set default values. But I really have to implement that. If done, you will be able to just set the default for the boolean values. For now I would recommend to not allow NULL but to set a default :)

@assertchris
Copy link
Author

I tried NULL with a default but couldn't get it to work. It created the table with the correct defaults but tried to set the booleans to NULL on insert/update... :/

@sdepold
Copy link
Member

sdepold commented Sep 1, 2010

hey I just implemented default values and the possibility declare a field as non-null/null field.

please let me know if this works nicely :) I will change the documentation soon, but for now:

s.define("foobar", {
aBoolean: { type: Sequelize.BOOLEAN, allowNull: false, default: false },
aString: Sequelize.STRING
})

this will define the field aBoolean with the default of false and which is not allowed to save a null value

furthermore you will get a field aString which is just the normal varchar string :)

@sdepold
Copy link
Member

sdepold commented Sep 1, 2010

if that works nicely i will push a new version 0.4 to github/npm

@sdepold
Copy link
Member

sdepold commented Sep 1, 2010

and the documentation: http://sequelizejs.com/#basicMapping

@assertchris
Copy link
Author

Very nice! Will try it out today.

@sdepold
Copy link
Member

sdepold commented Sep 6, 2010

this seems to work :)

sdepold pushed a commit that referenced this issue Sep 15, 2022
* feat(oracle): add oracle dialect support (#1)

* feat(oracle): add oracle dialect support

* fix: addressing review comments (#7)

* fix: addressing review comments

* fix: minor fixes done (#9)

* fix: minor fixes to the review comments

* fix: merge from sequelize-v6

* fix: enable newly added unit tests for Oracle dialect

* fix: remove dangling comma (#13)

* fix: doc gen is fixed

* fix: autogenerate the primary constraint name (#14)

* fix: autogenerate the primary constraint name

* fix: remove trailing comma

* fix: make changes to ORADERBY as per v6 sync

* fix: move test-unit-oracle above test-unit-all

* fix: rename getInsertQueryReturnIntoBinds to
  populateInsertQueryReturnIntoBinds

* fix: reorder parameters for function populateInsertQueryReturnIntoBinds

* fix: incorporated review comments (#16)

* fix: incorporated review comments

* fix: modify string empty check with !
WikiRik pushed a commit that referenced this issue Sep 22, 2022
* feat(oracle): add oracle dialect support (#1)

* feat(oracle): add oracle dialect support

* fix: addressing review comments (#7)

* fix: addressing review comments

* fix: minor fixes done (#9)

* fix: minor fixes to the review comments

* fix: merge from sequelize-v6

* fix: enable newly added unit tests for Oracle dialect

* fix: remove dangling comma (#13)

* fix: doc gen is fixed

* fix: autogenerate the primary constraint name (#14)

* fix: autogenerate the primary constraint name

* fix: remove trailing comma

* fix: make changes to ORADERBY as per v6 sync

* fix: move test-unit-oracle above test-unit-all

* fix: rename getInsertQueryReturnIntoBinds to
  populateInsertQueryReturnIntoBinds

* fix: reorder parameters for function populateInsertQueryReturnIntoBinds

* fix: incorporated review comments (#16)

* fix: incorporated review comments

* fix: modify string empty check with !

* feat: support for Oracle DB 18c

* Oracle DB version change

* added stop-oracle for 18

* fix: changes to DB version query

* fix: cleanup

* fix: describetable query fix

* fix: dbVersion to remove round trip and 18.4 json test fix

* fix: removed dbversion

* fix: removed comment

* fix: testing a feature

* fix: testing a feature

* fix: testing a feature

* fix: testing a feature

* fix: testing a feature

* fix: testing a feature

* fix: test

* fix: test

* fix: test

* fix: test

* fix: using semver to coerce version sring

* fix: update to instant client latest version for oracle db 21c

* fix: update to oracledb version in package.json

* fix: update lockfile

* fix: remove duplicate privileges.sql and wait-until-healthy.sh

* fix: changes to start-oracle alias

* fix: changes to start-oracle alias

* fix: changes to start-oracle alias

Co-authored-by: Sudarshan Soma <48428602+sudarshan12s@users.noreply.github.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants