Advertisement
Anatolyukropov

Sequalize UUID defaultValue

Aug 9th, 2021
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. up: async (queryInterface, Sequelize) =>
  2. queryInterface.sequelize.query('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";').then(function() {
  3. return queryInterface.addColumn('reserveCandidate', 'folderUuid', {
  4. type: Sequelize.UUID,
  5. defaultValue: Sequelize.literal('uuid_generate_v4()'),
  6. allowNull: false,
  7. });
  8. }),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement