Skip to content

Instantly share code, notes, and snippets.

@PabloCastellano
Created May 12, 2020 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PabloCastellano/95ec12f684343f8093734a6de1cb3e2f to your computer and use it in GitHub Desktop.
Save PabloCastellano/95ec12f684343f8093734a6de1cb3e2f to your computer and use it in GitHub Desktop.
Different SQL queries in openwisp-firmware-upgrader issue 53
These are the two extra queries that SAMPLE_APP=1 doesn't make
SELECT (1) AS "a" FROM "firmware_upgrader_firmwareimage" WHERE ("firmware_upgrader_firmwareimage"."build_id" = '8801eafe2d5c470ebb9ef87d322b8594' AND "firmware_upgrader_firmwareimage"."type" = 'ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin') LIMIT 1
SELECT (1) AS "a" FROM "firmware_upgrader_firmwareimage" WHERE ("firmware_upgrader_firmwareimage"."build_id" = '8801eafe2d5c470ebb9ef87d322b8594' AND "firmware_upgrader_firmwareimage"."type" = 'ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin') LIMIT 1
SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "openwisp_users_user"."password", "openwisp_users_user"."last_login", "openwisp_users_user"."is_superuser", "openwisp_users_user"."username", "openwisp_users_user"."first_name", "openwisp_users_user"."last_name", "openwisp_users_user"."is_staff", "openwisp_users_user"."is_active", "openwisp_users_user"."date_joined", "openwisp_users_user"."id", "openwisp_users_user"."email", "openwisp_users_user"."bio", "openwisp_users_user"."url", "openwisp_users_user"."company", "openwisp_users_user"."location", "openwisp_users_user"."phone_number" FROM "authtoken_token" INNER JOIN "openwisp_users_user" ON ("authtoken_token"."user_id" = "openwisp_users_user"."id") WHERE "authtoken_token"."key" = '30ce80ab05b3098e080f27768efc4ae6e19f4052' LIMIT 21
SELECT "openwisp_users_organization"."name", "openwisp_users_organization"."is_active", "openwisp_users_organization"."created", "openwisp_users_organization"."modified", "openwisp_users_organization"."slug", "openwisp_users_organization"."id", "openwisp_users_organization"."description", "openwisp_users_organization"."email", "openwisp_users_organization"."url" FROM "openwisp_users_organization" INNER JOIN "openwisp_users_organizationuser" ON ("openwisp_users_organization"."id" = "openwisp_users_organizationuser"."organization_id") WHERE "openwisp_users_organizationuser"."user_id" = 'c1e4a792804f409b8e9c3073364f8287' LIMIT 21
SELECT "django_content_type"."app_label", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "openwisp_users_user_user_permissions" ON ("auth_permission"."id" = "openwisp_users_user_user_permissions"."permission_id") INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "openwisp_users_user_user_permissions"."user_id" = 'c1e4a792804f409b8e9c3073364f8287'
SELECT "django_content_type"."app_label", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "auth_group_permissions" ON ("auth_permission"."id" = "auth_group_permissions"."permission_id") INNER JOIN "auth_group" ON ("auth_group_permissions"."group_id" = "auth_group"."id") INNER JOIN "openwisp_users_user_groups" ON ("auth_group"."id" = "openwisp_users_user_groups"."group_id") INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "openwisp_users_user_groups"."user_id" = 'c1e4a792804f409b8e9c3073364f8287'
SELECT "sample_firmware_upgrader_build"."id", "sample_firmware_upgrader_build"."created", "sample_firmware_upgrader_build"."modified", "sample_firmware_upgrader_build"."category_id", "sample_firmware_upgrader_build"."version", "sample_firmware_upgrader_build"."changelog", "sample_firmware_upgrader_build"."details" FROM "sample_firmware_upgrader_build" WHERE "sample_firmware_upgrader_build"."id" = '36ddbfa5954f4788a4c44e7631dcdc49' LIMIT 21
SELECT (1) AS "a" FROM "sample_firmware_upgrader_build" WHERE "sample_firmware_upgrader_build"."id" = '36ddbfa5954f4788a4c44e7631dcdc49' LIMIT 1
SELECT (1) AS "a" FROM "sample_firmware_upgrader_firmwareimage" WHERE "sample_firmware_upgrader_firmwareimage"."id" = '70ae746d779e40a29d3bb5fa3257c670' LIMIT 1
INSERT INTO "sample_firmware_upgrader_firmwareimage" ("id", "created", "modified", "build_id", "file", "type", "details") SELECT 'f6de31f007734fac8425a92539d29fcb', '2020-05-12 17:25:39.248290', '2020-05-12 17:25:39.248290', '36ddbfa5954f4788a4c44e7631dcdc49', '36ddbfa5-954f-4788-a4c4-4e7631dcdc49/openwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin', 'ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin', NULL
SELECT "authtoken_token"."key", "authtoken_token"."user_id", "authtoken_token"."created", "openwisp_users_user"."password", "openwisp_users_user"."last_login", "openwisp_users_user"."is_superuser", "openwisp_users_user"."username", "openwisp_users_user"."first_name", "openwisp_users_user"."last_name", "openwisp_users_user"."is_staff", "openwisp_users_user"."is_active", "openwisp_users_user"."date_joined", "openwisp_users_user"."id", "openwisp_users_user"."email", "openwisp_users_user"."bio", "openwisp_users_user"."url", "openwisp_users_user"."company", "openwisp_users_user"."location", "openwisp_users_user"."phone_number" FROM "authtoken_token" INNER JOIN "openwisp_users_user" ON ("authtoken_token"."user_id" = "openwisp_users_user"."id") WHERE "authtoken_token"."key" = '3379267714551928d13fc2e8a0ff23f4e20817d9' LIMIT 21
SELECT "openwisp_users_organization"."name", "openwisp_users_organization"."is_active", "openwisp_users_organization"."created", "openwisp_users_organization"."modified", "openwisp_users_organization"."slug", "openwisp_users_organization"."id", "openwisp_users_organization"."description", "openwisp_users_organization"."email", "openwisp_users_organization"."url" FROM "openwisp_users_organization" INNER JOIN "openwisp_users_organizationuser" ON ("openwisp_users_organization"."id" = "openwisp_users_organizationuser"."organization_id") WHERE "openwisp_users_organizationuser"."user_id" = 'b74a5cfb95ce49a78304e4004898aebb' LIMIT 21
SELECT "django_content_type"."app_label", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "openwisp_users_user_user_permissions" ON ("auth_permission"."id" = "openwisp_users_user_user_permissions"."permission_id") INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "openwisp_users_user_user_permissions"."user_id" = 'b74a5cfb95ce49a78304e4004898aebb'
SELECT "django_content_type"."app_label", "auth_permission"."codename" FROM "auth_permission" INNER JOIN "auth_group_permissions" ON ("auth_permission"."id" = "auth_group_permissions"."permission_id") INNER JOIN "auth_group" ON ("auth_group_permissions"."group_id" = "auth_group"."id") INNER JOIN "openwisp_users_user_groups" ON ("auth_group"."id" = "openwisp_users_user_groups"."group_id") INNER JOIN "django_content_type" ON ("auth_permission"."content_type_id" = "django_content_type"."id") WHERE "openwisp_users_user_groups"."user_id" = 'b74a5cfb95ce49a78304e4004898aebb'
SELECT "firmware_upgrader_build"."id", "firmware_upgrader_build"."created", "firmware_upgrader_build"."modified", "firmware_upgrader_build"."category_id", "firmware_upgrader_build"."version", "firmware_upgrader_build"."changelog" FROM "firmware_upgrader_build" WHERE "firmware_upgrader_build"."id" = '8801eafe2d5c470ebb9ef87d322b8594' LIMIT 21
SELECT (1) AS "a" FROM "firmware_upgrader_firmwareimage" WHERE ("firmware_upgrader_firmwareimage"."build_id" = '8801eafe2d5c470ebb9ef87d322b8594' AND "firmware_upgrader_firmwareimage"."type" = 'ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin') LIMIT 1
SELECT (1) AS "a" FROM "firmware_upgrader_build" WHERE "firmware_upgrader_build"."id" = '8801eafe2d5c470ebb9ef87d322b8594' LIMIT 1
SELECT (1) AS "a" FROM "firmware_upgrader_firmwareimage" WHERE ("firmware_upgrader_firmwareimage"."build_id" = '8801eafe2d5c470ebb9ef87d322b8594' AND "firmware_upgrader_firmwareimage"."type" = 'ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin') LIMIT 1
SELECT (1) AS "a" FROM "firmware_upgrader_firmwareimage" WHERE "firmware_upgrader_firmwareimage"."id" = '73517a5388ce497d8aeec623843247a4' LIMIT 1
INSERT INTO "firmware_upgrader_firmwareimage" ("id", "created", "modified", "build_id", "file", "type") SELECT 'a8b22fa589a747cda4831db09b4a3bbc', '2020-05-12 17:28:49.931078', '2020-05-12 17:28:49.931078', '8801eafe2d5c470ebb9ef87d322b8594', '8801eafe-2d5c-470e-bb9e-f87d322b8594/openwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin', 'ar71xx-generic-tl-wdr4300-v1-squashfs-sysupgrade.bin'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment