sqlite - Rails Migration - Constraints not working -


i'm new ruby on rails (switched laravel) , don't understand how migration constraints work.

in migration file have:

t.string :username, null: false, limit: 20 t.index :username, unique: true 

but when try create user username length exceed limit of 20 characters (or no value), works, unique constraint works , give me warning if try create second user same username.

i use sqlite development. when development.sqlite3 file, seems ok:

"username" varchar(20) not null 

if me, appreciated :)

thanks


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -