We're looking to add a column to the table user
called admin
(boolean
) in an existing database.
migrations
CREATE EXTENSION IF NOT EXISTS pgcrypto; | |
CREATE TABLE IF NOT EXISTS | |
users ( | |
email TEXT PRIMARY KEY CHECK ( email ~* '^.+@.+\..+$' ), | |
pass TEXT NOT NULL CHECK (length(pass) < 256), | |
role NAME NOT NULL CHECK (length(role) < 256) | |
); | |
CREATE TABLE IF NOT EXISTS |
/** | |
* @module describe-it | |
* | |
* This module defines global variables to provide unit test case runner functions compatible with mocha and jasmine. | |
* The codebase is written for brevity and facilitate being as lightweight as possible. | |
* | |
* The code is intended to be included in Postman Test Sandbox. | |
*/ | |
/** |
CREATE FUNCTION batch_at_will() RETURNS INTEGER LANGUAGE plpgsql AS $$ | |
DECLARE batched_count INTEGER = 1; | |
BEGIN | |
WITH selected_users AS ( | |
SELECT id | |
FROM users | |
WHERE role = 'moderator' | |
AND registration_date < CURRENT_DATE - INTERVAL '4' YEAR | |
LIMIT 1000 | |
FOR UPDATE NOWAIT |
package java8tests ; | |
import java.util.function.BiFunction ; | |
import java.util.function.Function ; | |
public class Currying { | |
public void currying() { | |
// Create a function that adds 2 integers | |
BiFunction<Integer,Integer,Integer> adder = ( a, b ) -> a + b ; |