Search
 
SCRIPT & CODE EXAMPLE
 

SQL

migrations.RunSQL

def set_pg_sequence(apps, schema_editor):
    if connection.vendor == "postgresql":
        # Reset sequence of user so Postgres doesn't crash on an existing user
        # ID 100 for our uploader user.
        # http://stackoverflow.com/a/3698777/85461
        migrations.RunSQL(
            """
            SELECT pg_catalog.setval(
                pg_get_serial_sequence('auth_user', 'id'), MAX(id)
            ) FROM auth_user;
            """.format(table_name=settings.AUTH_USER_MODEL)
        )
Comment

PREVIOUS NEXT
Code Example
Sql :: oracle insert multiple rows into same table 
Sql :: what is between operator 
Sql :: mysql split explode 
Sql :: ORA-06502: PL/SQL: numeric or value error: character string buffer too small 
Sql :: decimal to integer sql 
Sql :: what is ssrs and ssis in sql server 
Sql :: mysql procedure 
Sql :: duplicate a column in sql 
Sql :: sql limit 
Sql :: sqllite format 
Sql :: sql select column names starting with 
Sql :: are both the inserted and deleted tables used in update trigger 
Sql :: online compiler for sql plus 
Sql :: pl sql oracle trigger update exclude site:stackoverflow.com 
Sql :: sql server set column name as variable 
Sql :: cube oracle 
Sql :: sintaxis SELECT sql 
Sql :: where in clause tsql 
Sql :: sql convert to linq online 
Sql :: mysql add 24 hours to datetime 
Sql :: root mysqu 
Sql :: radius search with point data in mysql 
Sql :: How to calculate average of average salary of departments? 
Sql :: postgres automatic partioning a table 
Sql :: insert new department and employee record 
Sql :: mysql get last character of string 
Sql :: 165001709 
Sql :: cannot cast type numeric to boolean postgresql 
Sql :: turnicate in mysql 
Sql :: psql use query result convert Decimal python numpy psycopg2 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =